I am looking for a commutative cipher - that is
E(K₁,E(K₂,P)) = E(K₂,E(K₁,P))
but is not associative - that is
E(K,P) ≠ E(P,K)
That rules out XOR, which otherwise would have been ok.
A symmetric cipher would be preferable, but an asymmetric cipher would work too.
The basic protocol I want to implement is:
Can someone suggest a cipher I can use and also point me to an implementation of that cipher?
I have an understanding of cryptographic protocols and applications but I don't really grok the mathematics of most of the ciphers out there. Step-by-step mathematical guides would be ok though.
I plan to implement this in Clojure so any Java libraries are also good. However, any code is good because I understand code.
A commutative encryption is a kind of an encryption system that enables a plaintext to be encrypted more than once using different users' public keys. In this system, decryption is not required before the encryption/re-encryption processes.
Most symmetric encryption schemes (such as DES and AES) are not commutative.
128-bit AES encryption refers to the process of concealing plaintext data using an AES key length of 128 bits. 128-bit AES encryption uses 10 transformation rounds to convert plaintext into ciphertext and is approved by the National Security Agency (NSA) to protect secret but not top-secret government information.
It sounds like you're trying to implement "Mental Poker" (or if not, you should look up the research into it, since it's analagous to your problem).
The SRA algorithm has the properties you desire. It's a bit hard to find information on, but it is essentially just RSA except that both the e
and d
exponents are kept secret. Trivially:
(Pe1)e2 == (Pe2)e1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With