0
votes

I am having trouble understanding the RSA encryption algorithm.

Say we have two individuals Alice and Bob, each with their own private key and public key. In order for Alice to send out a message that only Bob can read, do we simply send an encrypted message with Bob's public key?

Likewise, in order for Alice to send a message that everyone can verify that it is from her, do we simply send an encrypted message with Alice's public key?

Thanks!

2

2 Answers

0
votes

What you need to understand is the Public Key Infrastructure. This structure consists of 2 keys per "user", one public, one private. PKI uses algorithms that can cipher a message using the public key of User1, and only knowing the private key of User1, can this message be deciphered. To use your example, Anyone can encrypt a message with Alice's Public Key, but only Alice can de-crypt it, because Alice is the only one who has the private key counter-part.

PKI or asymmetric ciphers, are slower than symmetric cipher, that is why PKI is only used as a precursor of symmetric key ciphers. For more info, see https://en.wikipedia.org/wiki/Public-key_cryptography.

0
votes

Say we have two individuals Alice and Bob, each with their own private key and public key. In order for Alice to send out a message that only Bob can read, do we simply send an encrypted message with Bob's public key?

Yes, the message is encrypted with Bob's public key and encrypted with private key. ( Be aware that the size of the message is límited by RSA key size, so for encryption of large message RSA encryption is used to share a symmetric encryption key)

Likewise, in order for Alice to send a message that everyone can verify that it is from her, do we simply send an encrypted message with Alice's public key?

It is not correct. This case if known as 'digital signature'. The message is digested with a hashing algorithm like SHA, and the result is encrypted with Alice's private key. This is the signature. Bob can verify the message and signature with Alice's public key (decrypt the signature and check that the hash of the message is the same that the encrypted one). If verification is succesful you know that It has been issued by Alice because she owns the private key