Support LQ: Use code LQ3 and save \$3 on Domain Registration
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org asymmetric key cryptography
 General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

 09-17-2008, 02:07 PM #1 leedude Member   Registered: Jan 2007 Location: Scotland Distribution: Fedora, Debian Posts: 81 Rep: asymmetric key cryptography Specifically, how does it work? i know the theory: alice makes a random number, and makes a public key and a private key from it. alice sends the public key to bob. bob encrypts the data with the key, and sends it to alice. alice decrypts the data with the private key. how are these keys generated? for instance, say i wanted to encrypt 23, 45, 12, 35. How would i generate the public(encryption) key and the private(decryption) key, given the random number 45436, so that the private key couldn't be derived somehow from the public one? What is a key generation function like? im not big on maths, but i understand modular arithmetic/calculus(a bit). This is bugging me. Lee. Last edited by leedude; 09-17-2008 at 02:19 PM.
 09-17-2008, 02:32 PM #2 w3bd3vil Senior Member   Registered: Jun 2006 Location: Hyderabad, India Distribution: Fedora Posts: 1,189 Rep: You could build your own algorithm for this, but its not all easy to build anything related to crypto which as cryptic as the current algos. If you want to have a look at how stuff is done refer to RSA module in perl. Should provide an insight. Heres a link You could also refer the sources of OpenPGP, which is used for email.
 09-17-2008, 02:40 PM #3 Quakeboy02 Senior Member   Registered: Nov 2006 Distribution: Debian Squeeze 2.6.32.9 SMP AMD64 Posts: 3,245 Rep: (Google is your friend) Unfortunately, if you're not big on math, then you're just going to have to accept that it works. On a high level, I can sort of understand Diffie-Hellman, which is probably the textbook case, but only if I apply myself to it. You can find an explanation of DH here: http://en.wikipedia.org/wiki/Diffie-Hellman. You can find the general case of asymmetric cryptography here: http://en.wikipedia.org/wiki/Public-key_cryptography.
09-17-2008, 03:57 PM   #4
H_TeXMeX_H
Guru

Registered: Oct 2005
Location: \$RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep:
Note this key phrase from the wiki:
Quote:
 The keys are related mathematically, but the private key cannot be practically derived from the public key.
This suggests to me that with enough computing power you can do it.

09-17-2008, 04:17 PM   #5
Quakeboy02
Senior Member

Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep:
Quote:
Originally Posted by H_TeXMeX_H
Note this key phrase from the wiki:

Quote:
 The keys are related mathematically, but the private key cannot be practically derived from the public key.
This suggests to me that with enough computing power you can do it.
When they say practically, they really mean it's not practical to bother trying to brute-force a modern crypto algorithm. Here's a good link for past and current massively-distributed cracking projects.

http://www.distributed.net/rc5/

 09-19-2008, 05:58 AM #6 chrism01 Guru   Registered: Aug 2004 Location: Sydney Distribution: Centos 6.6, Centos 5.10 Posts: 16,324 Rep: Here's a good handbook : http://www.gnupg.org/gph/en/manual.html
09-19-2008, 07:47 AM   #7
H_TeXMeX_H
Guru

Registered: Oct 2005
Location: \$RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep:
Quote:
 Originally Posted by Quakeboy02 When they say practically, they really mean it's not practical to bother trying to brute-force a modern crypto algorithm. Here's a good link for past and current massively-distributed cracking projects. http://www.distributed.net/rc5/
Yup, it certainly will take a long time, unless you have a cluster of supercomputers or something.

 09-19-2008, 09:12 AM #8 sundialsvcs Guru   Registered: Feb 2004 Location: SE Tennessee, USA Distribution: Gentoo, LFS Posts: 5,455 Rep: Public-key (asymmetric-key) cryptography is normally used just for keying systems. This is the initial-handshake that takes place when the two communicating systems are deciding upon (or the sender wishes to convey...) the private (symmetric) key that is to be used for a particular message. That private key is chosen randomly. By sending each message in a randomly-chosen private key, encryption can occur very fast (the math is simple...) and the key used to encrypt each message is now unique. That portion of the message which carries the per-message keying information is very small and unpredictable. When someone wants to "bust a key," they're not going to bother doing a brute-force search anyway. They're going to use some kind of a wedge: theft, break-in, torture, the expected characteristics of the message itself, guesses about the key ("it's a dictionary word...") and so-on.