dvsekhvalnov / jose-jwt

Ultimate Javascript Object Signing and Encryption (JOSE), JSON Web Token (JWT) and Json Web Keys (JWK) Implementation for .NET and .NET Core
MIT License
936 stars 184 forks source link

BCryptDecrypt error! #240

Open joaorstavares opened 6 months ago

joaorstavares commented 6 months ago

Hi

I'm trying to use the nuget package, however when decrypting a message and calling: status = BCrypt.BCryptDecrypt(hKey, cipherText, cipherText.Length, ref authInfo, ivData, ivData.Length, plainText, plainText.Length, ref plainTextSize, 0x0);

Visual Studio gives me error saying that BCrypt does not contain a definition for BCryptDecrypt.

Isn't this because BCryptDecrypt is declared as internal and not as public, like BCryptEncrypt is?

I'm kinda new at this.

Kind Regards, João Tavares.

joaorstavares commented 6 months ago

I think BCryptSetAlgorithmProperty has the same issue, has I get the same error from VS.

dvsekhvalnov commented 6 months ago

Hi @joaorstavares , confused, library is not asking to use BCryptDecrypt anywhere.

How did you get there? And what issues are you experiencing with library itself?

joaorstavares commented 6 months ago

I'm talking about the code in jose-jwt>crypto>AesGcm.cs

joaorstavares commented 6 months ago

I'm trying to decrypt a message in a .NET Framework project.

Since I cannot use System.Cryptography in it, I tried jose-jwt NuGet Package.

dvsekhvalnov commented 6 months ago

@joaorstavares, still not follow :(

jose-jwt is heavily relies on System.Cryptography, if you can't use it by some reason, library will not help much here, it can't work without.