-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about encrypt_to_keys with AES #223
Comments
PGP in general uses both public/private key based and symmetric encryption. The rough outline is
So when using pgp you will always have a choice for both pieces. The |
Thanks for the response! I very much appreciate the information :) pub fn encrypt(msg: &str, pubkey_str: &str) -> Result<String, anyhow::Error> {
let (pubkey, _) = SignedPublicKey::from_string(pubkey_str)?;
let msg = composed::message::Message::new_literal("none", msg);
let mut rng = StdRng::from_entropy();
let new_msg = msg.encrypt_to_keys(
&mut rng,
crypto::sym::SymmetricKeyAlgorithm::AES256,
&[&pubkey],
)?;
Ok(new_msg.to_armored_string(None)?)
} |
I'm trying to encrypt data with public keys, using rsa/ecdh, so I was looking at the function encrypt_to_keys, and I noticed that it uses a symmetric algorithm.
I'm using AES256 currently, but does that mean that anyone with the public key passed into the function will be able to decrypt as well?
I tried the openpgp rsa encryption test and had issues running it, so I'm trying using this example as a base.
If I'm going about this wrong, then my apologies I must have misread the documentation. Any help you can offer I would greatly appreciate.
The text was updated successfully, but these errors were encountered: