wood burning stoves 2.0*
The moose likes Security and the fly likes Need Fast and Simple Text Encryption    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Need Fast and Simple Text Encryption    " Watch "Need Fast and Simple Text Encryption    " New topic
Author

Need Fast and Simple Text Encryption

ayyappan Bas
Ranch Hand

Joined: Oct 11, 2008
Posts: 39
Hi, I need to implement text encryption in my program.
Though ive read about encryption before in passing I dont
know much about the different types so I was hoping someone
could help me pick one.


Thanks & Regards
Ayyappan
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
The Java API for encryption/decryption is called "JCE". The http://faq.javaranch.com/java/SecurityFaq has a number of links regarding that, including articles that have sample code for using the DES and AES ciphers in Java.

I'll move this to a more appropriate forum, since it has nothing to do with JSP. Please CarefullyChooseOneForum.


Ping & DNS - my free Android networking tools app
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Don't use DES for anything new. its OK to use it for legacy compatibility.

If you don't know, just use AES with 128 bit keys
shashank shekhar
Greenhorn

Joined: Jan 18, 2008
Posts: 4
You can also refer to this link for example code:
http://www.idevelopment.info/data/Programming/java/security/java_cryptography_extension/StringEncrypter.java
It shows encryption-decryption for 3 algorithms: Blowfish, DES, Triple DES
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
Originally posted by shashank shekhar:
You can also refer to this link for example code:
http://www.idevelopment.info/data/Programming/java/security/java_cryptography_extension/StringEncrypter.java
It shows encryption-decryption for 3 algorithms: Blowfish, DES, Triple DES


Don't go to that link! The code there contains atrocious and immoral exception handling, and just serves to poison the thinking of java beginners.


Nice to meet you.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Originally posted by greg stark:
Don't go to that link! The code there contains atrocious and immoral exception handling, and just serves to poison the thinking of java beginners.


Listen to Greg. That code is sinful. Especially the encrypt and decrypt routines. Never do it that way.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need Fast and Simple Text Encryption
 
Similar Threads
DES Encryption
Text Encryption
Encrypting a file at rest
decryption problem...
IDEA encryption in java.