I need to use a Delphi component to encrypt a file that can then be decrypted using a freely available utility. I’ve done some experimenting without success. Below I’ll list my requirements and what I’ve already attempted.
Requirements:
- Free component with source, if possible.
- Compatible with Delphi XE. As such, I’m only concerned about 32-bit support.
- Must be able to decrypt the result with a utility that is freely available for Windows.
Here’s what I’ve tried:
- LockBox 2, Rijndael 128-bit CBC
- LockBox 3, AES 128-bit CBC
- DCPCrypt2
- Decrypting each of the above with OpenSSL.exe
Other variables:
- I have not yet tried the Windows CryptoAPI. That is the next item on my list to attempt.
- I would prefer to use AES, but that is not a strict requirement.
- I would prefer not to use a private/public key pair. I would prefer the decryption to be possible using a password or passphrase.
I know SecureBlackBox components are highly regarded. If you know, from experience, that a SBB component can do what I’m looking for, then I’d love to know about it. It is an expensive option, but one we’ll consider if it’ll definitely work.
Please refrain from general recommendations to try a component that might work. I’m concurrently doing Google searches and attempting every viable option I can find. 🙂 I’d love to hear feedback from anyone that has experience doing what I’m attempting to do.
If your target is only Windows, why do not you just write this freely available utility?
You’ll ensure that it meets the same exact algorithm that in your application.
And you can add our Open Source unit to your list – I’ve just added CBC/ECB/CFB/OFB/CTR modes in AES 128, 192 or 256 bit – and PKCS7 padding pattern. And you have MD5, SHA1 or SHA256 fast functions to create your Key from a password.
You have full source code, and it works from Delphi 5 up to XE2, is FAST, maintained and cross-platform.
I use this unit for safe cypher between Delphi and C# code:
TAESCBC.EncryptPKCS7 / TAESCBC.DecryptPKCS7;This is a proven and simple scheme.