Share via


encrypt and decrypt with AES/GCM/NoPadding 256 bit

Question

Wednesday, June 6, 2018 6:33 AM

hi, experts, 

for my projects of my company , I need to use JDK 7 AES/GCM/NoPadding to  encrypt files with AES/GCM/NoPadding  256 bit and decrypt files using .NET C# , what libraries are suggested ?

thank you very much!

delay no more

delaynomore.

All replies (3)

Thursday, June 7, 2018 2:33 AM

hi,experts, any one help me ?

delaynomore.


Thursday, June 7, 2018 5:05 AM

You need to wait more than 20 hours before following up like this.  Most of us are volunteers.

Have you done any searching about this?  The System.Security.Cryptography namespace includes AES encryption, but it doesn't support the GCM cipher.  Here's a blog post that shows an example using another library:

https://codereview.stackexchange.com/questions/175141/encrypt-and-decrypt-a-message-using-aes-256-with-gcm-mode-using-bouncy-castle-c

Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.


Thursday, June 7, 2018 10:56 AM

You can just use AuthenticatedAesCng class in Security.Crypography NuGet package from Microsoft to do encryption/decryption.

Specify NoPadding to aes.Padding. Sample usage is at the linked source code page as example tag.

EDIT: Btw, seems it does supports GCM cipher.

https://codereview.stackexchange.com/questions/13714/symmetric-encryption-decryption-routine-using-aes

https://blogs.msdn.microsoft.com/shawnfa/2009/03/17/authenticated-symmetric-encryption-in-net/