• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Fast and Simple Text Encryption

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Pat Farrell
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic