G
G
genek_orlov2018-11-22 23:16:01
Python
genek_orlov, 2018-11-22 23:16:01

RSA encryption in PYTHON. How to initially generate a public key, and on another device, having a public key, generate a private one?

It is necessary to generate a public key using it to encrypt information and then send a public key to another device and use the public key to generate a private key and decrypt the text

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2018-11-22
@Rsa97

You don't understand the meaning of the keys. If one key could be used to restore the second, then they would not provide any protection.
The correct scheme looks like this:
Device A generates a key pair and shares the public key.
Device B downloads the public key, encrypts the document with it, and sends it to device A.
Device A, using the paired private key, decrypts the document.

X
xmoonlight, 2018-11-23
@xmoonlight

5bf71d6938a23614085310.png

C
CityCat4, 2018-11-23
@CityCat4

Do this - and all the hackers of the world will erect a monument to you. From pure gold. It is impossible
to restore the second key from one key . Google about public key cryptography.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question