|
Cryptography
プレゼンテーションモードでも利用可能
Symmetric vs. Public
Symmetric-key Cryptography
- Data Encryption Standard (DES)
- Advanced Encryption Standard (AES)
- Triple-DES
- International Data Encryption Algorithm (IDEA)
- Blowfish, Twofish, CAST5, TIGER
DES
- 1977 National Security Agency, USA
- 56 bit key (8 ASCII characters)
- 64 bit block
- 16 rounds Feistel function (F function)
Unix Password and DES
How to use DES encryption on Mac OS X
- Use openssl
- Which is installed in /usr/bin/openssl
- Create some plain text (plain.txt)
- openssl enc -des -in plain.txt -out des.dat
- Prompted for the symmetric key (password)
- openssl enc -des -d -in des.dat
Try Other Symmetric encryption
- Issue unknown command for openssl and get cipher commands
- aes128, aes192, aes256, bf, cast, cast5, des3, rc2, rc5
Message Digest / Hash
- Like DES password, one-way encryption
- For long message, short and (almost) uniq value
- MD5
- SHA1
- MD4, MD6, SHA0, SHA2(family) etc.
Try Hash
- MD5:
$ md5 plain.txt
MD5 (plain.txt) = 37dc0b726db8aba5c32f256719894fa5
$ openssl dgst -md5 plain.txt
MD5(plain.txt)= 37dc0b726db8aba5c32f256719894fa5
- SHA1:
$ openssl dgst -sha1 plain.txt
SHA1(plain.txt)= 03172a67a9770f970e7d74af06cdb6903d5a91f2
Public-key Cryptography
RSA
- two primes (p, q)
- n = p q
- d e = 1 (mod {(p-1)(q-1)})
- Encryption : c = me mod n
- Decryption : m = cd mod n
RSA Key by OpenSSL
Encrypt/Decrypt
Sign
Pretty Good Privacy (PGP/OpenPGP/GnuPG)
Quiz of the Day
- Which key do you use to do followings, private key or public key ?
- Encrypt a message
- Decrypt the encrypted message
- Sign a message
- Verify the signature
|
|