# Is there an encryption that is only reversible with a key?

What I'm imagining is an encryption that takes input A and creates an encrypted result, Ax. Like hashing, if you have Ax, you can't mathematically figure out A. But unlike hashing, there is a key (or salt or whatever). If you have Ax and the key, then you can use it to produce A.

Does something like that exist?

(P.S., I know the correct way to send passwords over the internet is in HTTPS, which is why I came here instead of security.SE.)

• There is the one time pad. – xavierm02 Aug 12 '14 at 21:44
• – user991 Aug 12 '14 at 21:46
• You are describing public key encryption. – Jeff-Inventor ChromeOS Aug 12 '14 at 22:28
• Ah, I just looked up one time pad--that's exactly what I was looking for. I think public key encryption is different, since there are two keys (public and private) as I understand it? Anyway, the one time pad thing is exactly what I was thinking about. – brentonstrine Aug 12 '14 at 23:09
• Isn't reversible encryption just encryption? – bmm6o Aug 13 '14 at 0:27