aspose file tools*
The moose likes Java in General and the fly likes already written java code for encryption and decryption Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "already written java code for encryption and decryption" Watch "already written java code for encryption and decryption" New topic
Author

already written java code for encryption and decryption

Adedeji Adedoyin
Greenhorn

Joined: Aug 12, 2011
Posts: 9
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

Joined: Dec 09, 2011
Posts: 155

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.


Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Adedeji Adedoyin
Greenhorn

Joined: Aug 12, 2011
Posts: 9
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

Joined: Dec 09, 2011
Posts: 155

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

Joined: Jul 26, 2007
Posts: 10451
    
    8

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


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

Probably an easy User Interactive Example to start you off you would be;

Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

I hope I did Not give the Proverbial beggar A Fish.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
It should be noted that a hash is generally not considered an encryption, since hashing can't be reversed.
Adedeji Adedoyin
Greenhorn

Joined: Aug 12, 2011
Posts: 9
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
Start with the articles Stanley and Maneesh posted; those should get you going.
Adedeji Adedoyin
Greenhorn

Joined: Aug 12, 2011
Posts: 9
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

Joined: Aug 12, 2011
Posts: 9
Jus want to correct a mistake...the variable name for the second string should be "plaintext2" not "plaintext"..
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3682
    
  16
Please note the following words do not exists in English d, shud, dis
At least not in the context you are using them.


Joanne
Adedeji Adedoyin
Greenhorn

Joined: Aug 12, 2011
Posts: 9
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

Joined: Oct 29, 2001
Posts: 8927
    
    9


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".


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Nishanth Thomas
Greenhorn

Joined: Sep 08, 2011
Posts: 7


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: already written java code for encryption and decryption