Photo by Erik Mclean on Unsplash

Can Alice Encrypt With Her Public Key, and Bob Decrypts With His Private Key? Meet Transform (Proxy-) Encryption in Rust

--

Last we a student took one of our cryptography test and answered a question saying that Alice will use her public key to encrypt for Bob, and then Bob uses his private key to decrypt. Well, I marked it wrong … and for good reason. But there is a method that does this, and it is named transform (or proxy-)encryption.

Basics

Now you should know that in public-key encryption, that you can have a public key and a private key. Normally if Alice sends encrypted data to Bob, he will use his public key to encrypt the data (Bpub), and then Bob would use his private key (Bpriv) to decrypt it.

But now let’s say we have two key pairs: (Apriv, Apub) and (Bpriv, Bpub), and who are owned by Alice and Bob, respectively. Could we encrypt with Alice’s public key (Apub) and then for it to be decrypted with Bob’s private key (Bpriv)? This is known as transform encryption, and where we have a special transform key (Apub -> Bpub) using Alice’s private key (Apriv) and Bob’s public key (Bpub). We then could pass the encrypted data, encrypted with Alice’s public key (Apub) to Trent, and then to also send Trent the transformation key. Trent can then create the required ciphertext for Bob, and which he can only…

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.