• Post Reply Bookmark Topic Watch Topic
  • New Topic

3DES encryption and decryption  RSS feed

 
bala chander
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am totally new to JAVA....How can i encrypt and decrypt a string using 3DES algorithm.I have got an key and IV.Please help me on this.......
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bala chander:
Hi,
I am totally new to JAVA....How can i encrypt and decrypt a string using 3DES algorithm.I have got an key and IV.Please help me on this.......


In Java, the built-in triple DES algorithm (variant) goes under the name "DESede". If you already have the key, then you encrypt like so...



And decrypt like so...



Henry
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless its a homework assignment, why would you use 3DES for anything new? Java also has AES-128, which is faster than 3DES and as strong. Perhaps stronger, its hard to tell.

DES is old and deprecated.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!