• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

already written java code for encryption and decryption

 
Adedeji Adedoyin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am thinking if I could get an already written java code that can encrypt and at d same time decrypt...instead of me having to go learn how to use java's cryptography technology..
 
Stanley Mungai
Ranch Hand
Posts: 155
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch,
I have a ready code that encrypt and decrypt Strings and I would really like to help. But that is not the Practice here. Try a code, if it does not work , let us know what the problem is and we will surely help. We only need to see that you tried. Otherwise, Ready Made codes are just a wrong way to learn Java.....and we really want you to learn.
 
Adedeji Adedoyin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot sir...that sounds like the best idea..learn rather than rely on ready-made codes...

Please I would be so grateful if you could tell me how to start with java cryptography tutorials..probably you could recommend a good book that I can start with or video tutorials..thanks alot
 
Stanley Mungai
Ranch Hand
Posts: 155
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.ibm.com/developerworks/java/tutorials/j-sec1/
for the basics, Or you can read the E-book at
http://www.digitallibrary.kcci.com.pk/bitstream/32417747/138/1/%28ebook-pdf%29%20-%20O%27Reilly%20Java%20Cryptography.pdf

Try and try and try and never be afraid to try. If you get an issue, You will find a lot of guys here ready to help.
I hope this helps.
 
Maneesh Godbole
Saloon Keeper
Posts: 11196
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adedeji Adedoyin wrote:...if you could tell me how to start with java cryptography tutorials..

Recommended reading http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html
 
Stanley Mungai
Ranch Hand
Posts: 155
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably an easy User Interactive Example to start you off you would be;

 
Stanley Mungai
Ranch Hand
Posts: 155
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope I did Not give the Proverbial beggar A Fish.
 
Tim Moores
Bartender
Posts: 2957
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be noted that a hash is generally not considered an encryption, since hashing can't be reversed.
 
Adedeji Adedoyin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much to everyone that has contributed to dis thread....I am very grateful...am a first_timer right here in coderanch....and am so glad am beginning to get solutions. To problems as regards to java programming....I still will welcome many more comments on dis topic...
 
Tim Moores
Bartender
Posts: 2957
46
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start with the articles Stanley and Maneesh posted; those should get you going.
 
Adedeji Adedoyin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot to all those that responded earlier...I have started with the tutorial on IBM's website...and I have 2 questions to ask

1)I discoverd that different digests were created for two strings containing d same words..example

String plaintext="americanvisa";

String plaintext="americanvisa";

Produced different digest output(using toString())..why is this so?..I thought the same digest shud be generated for strings containing d same words...

2)Now..given the fact that equal strings produce different digests..then how do we really compare to knw if a data was tampered with or not...
 
Adedeji Adedoyin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jus want to correct a mistake...the variable name for the second string should be "plaintext2" not "plaintext"..
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note the following words do not exists in English d, shud, dis
At least not in the context you are using them.
 
Adedeji Adedoyin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry for the mis-use of words by the use of abbreviations...henceforth,I will take note of this...thank you
 
Joe Ess
Bartender
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

2)Now..given the fact that equal strings produce different digests..then how do we really compare to knw if a data was tampered with or not...


Can you show us the code you are using? My wild guess is that you are not "resetting" the digest before getting the second result, in effect comparing the digest of "americanvisa" with "americanvisaamericanvisa".
 
Nishanth Thomas
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic