OpenSSL encryption using .NET classes

前端 未结 2 899
陌清茗
陌清茗 2020-11-30 01:21

I\'m looking to create a class that uses the .NET libraries that is compatible with OpenSSL. I\'m aware there is an OpenSSL.Net wrapper, but I would prefer to avoid referen

2条回答
  •  天命终不由人
    2020-11-30 01:51

    Afraid there are issues with this latest code as well as OpenSSLDecrypt results in an error:

    Padding is invalid and cannot be removed.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for >more information about the error and where it originated in the code.

    Exception Details: System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.

    It occurs at the closen paren of this code:

    using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))" in 'static string DecryptStringFromBytesAes(byte[] cipherText, byte[] key, byte[] iv)

    I had no idea it would be this hard to encrypt a blob of text from one computer, then send it for storage and decryption to another.

提交回复
热议问题