This is probably slightly outside the domain of these forums, but cryptography is a mathematical process so I'll ask: Generally keys are used to encrypt data, and another matching key is used to decrypt it, at least in public key cryptography (which is what I'm interested in). My question is whether or not it is possible to reverse engineer one of these keys given both the encrypted and unencrypted data streams? In other words, if an attacker has both the input and output of the encryption process, and know the internals of the algorithm could they attack the key and compromise it? Does it vary based on the encryption algorithm? If it can be done, how big of a risk does it pose to existing systems?