ahodder
ahodder

Reputation: 11439

How secure is javax.crypto.Cipher?

I know enough about cryptology to make life difficult for a novice programmer and get laughed at by security experts. So with that in mind, I ask: how secure is javax.crypto.Cipher? I realise that anything can be cracked by someone with a will and a way, but I still would like to know relative details.

The reason I ask is I would like to store account names and passwords that will be sent through my Cryptor class that will encrpyt them, and would like to know if this will do the job. If any one has any literature that I could read, that would be greatly apprieciated.

Thanks ~Aedon

Upvotes: 5

Views: 6413

Answers (3)

emboss
emboss

Reputation: 39630

If you intend to store passwords securely, then your requirements are quite different from simply "communicating securely/privately". A Cipher on its own is not enough to protect you. You need to use one of these

in that circumstance. Here are some arguments and links concerning password security.

The punchline is that "normal" encryption (or hashing, too) is just way too fast to hold off serious attackers. You want to artificially slow down the entire process to make it as hard as possible for somebody systematically attacking your application. A single user won't notice the difference between 1 or 500 milliseconds when entering a password but for an attacker this means that in order to break your scheme it will take them 500 times as long on the average - so if it would have taken roughly 1 month to find a valid password before, now it will take 500 months.

Upvotes: 5

JB Nizet
JB Nizet

Reputation: 691785

Cipher is a generic class to apply an encryption/decryption algorithm. Its security depends on the actual encryption algorithm used (DES, triple-DES, AES, etc.), on the size of its key, and on the block chaining type that you choose.

Upvotes: 7

emory
emory

Reputation: 10891

Since NullCipher is a Cipher - not secure at all.

Upvotes: 0

Related Questions