lminuti / Delphi-OpenSSL

Delphi wrapper for OpenSSL
139 stars 62 forks source link

AES256 Decrypt with PrivateKey (Certificate) #5

Open jindrichvolek opened 4 years ago

jindrichvolek commented 4 years ago

Hello please, how to decrypt AES256 with PrivateKey (Certificate) Thx.

lminuti commented 4 years ago

You can see the code here: https://github.com/lminuti/Delphi-OpenSSL#encrypt-with-aes256 But AES256 is a symmetric algorithm, it uses a key and an initialization vector to encode the data not a certificate. DelphiOpenSSL has a special record (TPassphrase) that can generate key and IV from a string.

jindrichvolek commented 4 years ago

Hello thx for answer. I receive some encrypted data from goverment institution. As descripted - they are encrypted aes256 with public qualified certificate:

UZI5445..............

and I don’t know, how it decrypted... J.Volek From: Luca Minuti Sent: Monday, January 20, 2020 9:10 AM To: lminuti/Delphi-OpenSSL Cc: jindrichvolek ; Author Subject: Re: [lminuti/Delphi-OpenSSL] AES256 Decrypt with PrivateKey (Certificate) (#5)

You can see the code here: https://github.com/lminuti/Delphi-OpenSSL#encrypt-with-aes256 But AES256 is a symmetric algorithm, it uses a key and an initialization vector to encode the data not a certificate. DelphiOpenSSL has a special record (TPassphrase) that can generate key and IV from a string.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lminuti commented 4 years ago

I'm sorry but I never use AES with certificate. You can try to inspect the certificate with something like: openssl x509 -in your_cerificate -text and try to extract the key.