You're describing a form of three-pass protocol, which is a communication mechanism where neither party needs to know each other's secret key. Wikipedia describes a helpful metaphor using a box that can be locked by two padlocks:
First, Alice puts the secret message in a box, and locks the box using a padlock to which only she has a key. She then sends the box to Bob through regular mail. When Bob receives the box, he adds his own padlock to the box, and sends it back to Alice. When Alice receives the box with the two padlocks, she removes her padlock and sends it back to Bob. When Bob receives the box with only his padlock on it, Bob can then unlock the box with his key and read the message from Alice.
I assume you're using multiplication and division simply as example functions, but as others have mentioned these aren't suitable operations for this task because they're too easy to reverse. However there do exist actual encryption and decryption functions which do work this way - the necessary property is for the operations to be commutative, so that the encrypting and decrypting do not need to be done in a certain order.
In order for the encryption function and decryption function to be suitable for the Three-Pass Protocol they must have the property that for any message m
, any encryption key e
with corresponding decryption key d
and any independent encryption key k
, D(d,E(k,E(e,m))) = E(k,m)
. In other words, it must be possible to remove the first encryption with the key e
even though a second encryption with the key k
has been performed. This will always be possible with a commutative encryption. A commutative encryption is an encryption that is order-independent, i.e. it satisfies E(a,E(b,m))=E(b,E(a,m))
for all encryption keys a
and b
and all messages m
. Commutative encryptions satisfy D(d,E(k,E(e,m))) = D(d,E(e,E(k,m))) = E(k,m)
.
...
A [further] necessary condition for a three-pass algorithm to be secure is that an attacker cannot determine any information about the message m
from the three transmitted messages E(s,m)
, E(r,E(s,m))
and E(r,m)
.
This second condition eliminates multiplication and division, since we could look at the three transmitted messages s*m
, r*s*m
, and r*m
and easily compute m
from them.