Skip to content

Decryption failed: EVP_DecryptFinal_ex:bad decrypt #9

Description

@Refraction0602

Hello, I have a question about Des decryption.

snmp agent v3 Settings:
Auth Protocol: HMACMD5
Privacy Protocol: CBC-DES

snmp2 client Settings:

let security = Security::new(b"****", b"****")
        .with_auth_protocol(AuthProtocol::Md5)
        .with_auth(Auth::AuthPriv { cipher: Cipher::Des, privacy_password: b"*****".to_vec() });

An error occurred when decrypting the response data:

error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:cryptoevpevp_enc.c:612:

After I modified part of the source code, the error disappeared:

// v3.rs ->  Security -> decrypt_des
let mut crypter =
    openssl::symm::Crypter::new(cipher, openssl::symm::Mode::Decrypt, des_key, Some(&iv))?;
crypter.pad(false); // add new

Is this a problem? Or can I have other Settings that I don't know?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions