Is it possible to encrypt in a different order than decryption?

Can I encrypt in one order and decrypt in another? For example, I have the following:

  • plain_text.txt
  • Folder "Public / Private Key" 1
  • Open / Closed key pair 2

Example

Encryption:

public1(public2(plain_text.txt))

decryption:

private1(private2(encrypted))

Is there an encryption algorithm that allows this? Is it possible?

+3
source share
6 answers

. , , . , , ElGamal.

: , g G, . x A x B - , h A= g x A h B= g x B . G (.. p, G = Z/(p)). ElGamal, - , ( ). RSA, , .

m h A

(m h A r g r).

, x A ,

(g r) x A= h A r

, . r '

(mh A r h A r ' g r g r ') = (m h A r + r ' g r + r').

- A. , , , RSA , . B,

(mh A r + r ' h B s g r + r' g s).

, . , x A

(g r + r ') x A= h A r + r'

, ,

(m h B s g s),

: m B.

, . . ., , Phd of Stephen Weis, .


, " RSA". , , , A B . . A (n, e A, d A) B (n, e B, d B), n - , e A, e B d A, d B . , , (n, e A, d A), n , , B, , , .

m

m e A mod n,

m e A e B mod n,

,

m e B mod n,

B, m. , , , c = m e A mod n c '= m e B mod n r, s ,

r e A + s e B= 1

m = c r (c ') s mod n.

RC4, . .

+5

RSA . , ( ) , . , blob .

/* RSA AFAIK, ( ). , , . */

, . , , , , cyphertext .

OpenSSL , , . , .

EDIT: , - 99,9% . , ; (, -, ), .

EDIT2: RSA , . . , , . (m, d) Cindy (m, d ') - m - d' O (m) , /cyphertext Cindy. .

+3

/ . PubK1(PubK2(plain.text)) = > encrypted.text. PrivK2(PrivK1(encrypted.text)).

, , RC4, (A xor B xor C = C xor B xor A). / .

+1

, . (?) .

+1

AFAIK RSA. , .

0

, . , , , .

EDIT: , RSA. , .

EDIT2: , .

0

Source: https://habr.com/ru/post/1727299/


All Articles