There are two main uses for encryption:
- Encrypting your files to prevent snoops from looking at them. Snoops can look at your files without knowing
your login password by booting with an Ubuntu Linux CD and
examining your files, bypassing Windows and its passwords. Possible tools to encrypt (scramble) your files
include:
- Microsoft Encrypt available in right click properties.
- Bundled encryption software such as Acer e-Protect.
- Commercial file encryption software. There are dozens of choices. I have no experience with them.
Keep in mind none of them will stop the IRS, FBI, CIA, KGB, Mosad etc. These are designed to stop
individual snoops.
Beware! If you lose your password, there is no way ever to get your files back.
- Encoding messages in ways so that people snooping on them won’t be able to make sense of them.
Depending on who the spies are that you are trying to defeat, you use increasing strength of encryption. The stronger the encryption the more onerous it is to use, and the more
computing power it requires to encode and decode the messages. Ways of encrypting include:
- XORing with a key phrase. This is relatively trivial to crack, but keeps out casual prying eyes.
- DES. This is fast, but can be easily cracked by all US government agencies.
- RSA. 40-bit can be fairly easily cracked. 1024-bit or higher would require secret special-purpose
hardware that presumably the CIA has. The Transporter supports
up to 4096-bit enryption, but is suitable only for short messages because it
is so slow at decrypting.
- One time pad. This is in theory uncrackable, but has the problem of needing to distribute one-use-only
keys just as large as the messages ahead of time. I have written a Pascal implementation. If you are working at this level of security, you
must write your own program to be sure it contains no trojans.
- JCE supports a number of different algorithms from 40 to 2048 bits. The
more bits, the more secure, but the more CPU time needed to encryt and decrypt. You use the generic
javax.crypto.Cipher class both to encrypt and decrypt the message. You use the
javax.crypto.KeyGenerator class to generate random numbers to use as keys.
- AES: Advanced Encryption Standard as specified by NIST in a draft FIPS. Based on the Rijndael algorithm
by Joan Daemen and Vincent Rijmen, AES is a 128-bit block cipher supporting keys of 128, 192, and
256 bits.
- Blowfish: 56 bits. The block cipher designed by Bruce Schneier.
- DES: 56 bits. The Digital Encryption Standard as described in FIPS PUB
46-2.
- DESede: 112 bits. Triple DES Encryption (DES-EDE).
- PBE: Password Based Encryption
algorithm (defined as part of the PKCS #5 standard), defines how some other alogrithm can get its its key.
It derives the encryption key from a passphrase. It is not an enryption algorithm on its own.
- RC2, RC4, and RC5: Variable-key-size (32 .. 160-bit) encryption
algorithms developed by Ron Rivest for RSA Data Security, Inc.
- RSA: The RSA encryption algorithm as defined in PKCS #1. Public/private key.
- HMAC-MD5, HMAC-SHA1 : 64 bits.
- Diffie-Hellman : 1024 bits.
These techniques are often combined, e.g. public/private key (which is slow) used to exchange a fast DES, or
HMAC-SHA1 for authentication combined with AES for encryption.
For email signing and encryption, the two most common schemes are PGP often used
with Eudora, and smime often used with MS Outlook.
Encryption algorithm work on blocks, usually of some power of 2, e.g. 256 bits. If
your message is not a multiple of that size, you need to pad it, and when you decrypt it, discard the excess.
That is handled automatically when you select a JCE padding algorithm such as: ISO10126Padding, PKCS1Padding,
PKCS5Padding…
The blocking algorithm handles breaking the messages into fixed size pieces for encryption and joining the
pieces again on decryption such as: CBC, PCBC, CFB, OFB…
For data that only has to be protected until 2010, 1024 bits should suffice. For data that has to remain secret after that, you need 2048 bits.
Learning More
Sun’s JDK Technote Guide on
AlgorithmParameterGenerator names : available:
Sun’s JDK Technote Guide on
CertificateFactory names : available:
Sun’s JDK Technote Guide on
CertPathBuilder Algorithm names : available:
Sun’s JDK Technote Guide on
CertPathEncodings names : available:
Sun’s JDK Technote Guide on
CertPathValidator names : available:
Sun’s JDK Technote Guide on
CertStore Type names : available:
Sun’s JDK Technote Guide on
Cipher Blocking Algorithm names : available:
Sun’s JDK Technote Guide on
Cipher Padding Algorithm names : available:
Sun’s JDK Technote Guide on
KeyAgreement Algorithm names : available:
Sun’s JDK Technote Guide on
KeyFactory Algorithm names : available:
Sun’s JDK Technote Guide on
KeyGenerator Algorithm names : available:
Sun’s JDK Technote Guide on
KeyPairGenerator Algorithm names : available:
Sun’s JDK Technote Guide on
KeyStore Type names : available:
Sun’s JDK Technote Guide on
Mac Algorithm names : available:
Sun’s JDK Technote Guide on
MessageDigest Algorithm names : available:
Sun’s JDK Technote Guide on
Signature Algorithm names : available:
Sun’s JDK Technote Guide on
XMLSignature Algorithm names : available:
Sun’s JDK Technote Guide on
Other JCE : available: