wood burning stoves 2.0*
The moose likes Java in General and the fly likes What is the difference between Pubkey and Cipher? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "What is the difference between Pubkey and Cipher?" Watch "What is the difference between Pubkey and Cipher?" New topic
Author

What is the difference between Pubkey and Cipher?

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
I ran command line- gpg --version

it displays following information-

Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH, CAMELLIA128,
CAMELLIA192, CAMELLIA256

Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB

I know Pubkey(RSA) and Cipher(CAST5) are both algorithms. Both are used to encrypt the data. So what is the difference between them?

Is it RSA provides assymetric vs symmertic algorithm and also provides key-pairs. Cipher would be another algorithm to encrypt the data using key pairs generated by RSA? Am I correct in my thinking?


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
John Gerso
Greenhorn

Joined: May 31, 2011
Posts: 6
Cipher algorithms use the same key for both encryption and decryption (or one is easily derivable from the other). This requires both parties to agree on the secret key prior to sending the message, or for the encryption key to be sent (and be susceptible to be intercepted).

Pubkey algorithms use different keys for encryption and decryption, and allow free transfer of the public key to anyone that asks for it(no prior agreement needed).
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Thanks.

Doesn't sounds perfect to me. Then how would you explain a scenario where combination of RSA/CAST5 is used?
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Amandeep Singh wrote:Thanks.

Doesn't sounds perfect to me. Then how would you explain a scenario where combination of RSA/CAST5 is used?


Looks like you have not read what I wrote in your other thread with regards to how PGP encryption is done.

You need to spend more time reading and less time coding.


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
you are right, I have to read more to get the concept. Currently I am more inclined to deliver the code.

Do you recommend any book or just reading the documentation is sufficient?

BTW the other user just confused me. Do you agree with my understanding, the one posted in starting of thread?
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Amandeep Singh wrote:you are right, I have to read more to get the concept. Currently I am more inclined to deliver the code.


Make sure that your public liability insurance is fully paid up.


Do you recommend any book or just reading the documentation is sufficient?


The documentation most definitely not sufficient. A forum is most definitely not the place to start your education. If you are serious about using cryptography in Java then a good starting point is "Beginning Cryptography with Java" by David Hook published by Wrox BUT BUT BUT it does not cover PGP. For PGP start with http://en.wikipedia.org/wiki/Pretty_Good_Privacy and follow your nose from there.


BTW the other user just confused me. Do you agree with my understanding, the one posted in starting of thread?


The other poster looks in essence to be right but his use of 'cipher' in his first sentence is misapplied and confusing. I think he meant to start with "Symmetric Cipher algorithms" but I can't read his mind.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is the difference between Pubkey and Cipher?
 
Similar Threads
Encrypting and Decrypting Strings.
Encryption of long strings
problem with RSA..... folks please help!
need to generate RSA keys from txt files
Is cast5 128 supported by default sun JCE provider?