Skip to content

Commit

Permalink
fix: change key type to RSA 4096
Browse files Browse the repository at this point in the history
chore: remove unused code
  • Loading branch information
alexng353 committed Sep 2, 2024
1 parent 8b9d4fe commit 834cc65
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/utils/rpgp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ pub fn generate_key_pair(
) -> Result<KeyPair, anyhow::Error> {
let mut key_params = composed::key::SecretKeyParamsBuilder::default();

key_params.key_type(composed::KeyType::Rsa(2048));

// name email mix, + salt and hash as the primary_user_id
key_params
// change to 4096 later
// change to C25519 later
// .key_type(composed::KeyType::ECDH(ECCCurve::Curve25519))
.key_type(composed::KeyType::Rsa(4096))
.can_certify(false)
// .can_create_certificates(false)
.can_sign(true)
.can_encrypt(true)
.passphrase(Some(password.clone()))
Expand Down Expand Up @@ -141,15 +138,7 @@ pub fn decrypt(
.to_string()
.context("Failed to convert literal to string")?;

return Ok(clear_text);

// if let Some(msg) = decryptor.next() {
// let bytes = msg?.get_content()?.context("Failed to get content")?;
// let clear_text = String::from_utf8(bytes)?;
// return Ok(clear_text);
// }

// Err(anyhow::Error::msg("Failed to find message"))
Ok(clear_text)
}

pub fn hash_string(input: &str) -> String {
Expand Down

0 comments on commit 834cc65

Please sign in to comment.