quickbeam Posted July 1 Posted July 1 I have code on another device and I'm trying to send encrypted data to it. I can store a key there and decrypt data, but I don't see how store the same key in AutoIt. Yes, Diffie-Hellman Key Exchange might be a better solution, but I don't see how to do that in the other device. To use _Crypt_EncryptData, I need a handle from_Crypt_DeriveKey(). That wants a password as an input, and then it will derive a session key, but I just want to store a known binary value. Is there a way to do that?
RTFC Posted July 2 Posted July 2 Diffie-Hellman is definitely the way to go; don't bother with _Crypt_*. I use this C++ library myself, but @jchd has provided this AutoIt implementation. My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
quickbeam Posted July 2 Author Posted July 2 Unfortunately my other device (an embedded device) doesn't support Diffie-Hellman. I was just hoping for a simple way to use AES with a given key, not a password.
Solution TheXman Posted July 2 Solution Posted July 2 (edited) 28 minutes ago, quickbeam said: I was just hoping for a simple way to use AES with a given key, not a password. This may help. Taken from the CryptoNG Purpose statement: Quote ... In addition the Crypt.au3 UDF lib, as it is currently written, has a very limited ability to decrypt AES data that was not encrypted using Crypt.au3 functions. That is because Crypt.au3 functions do not allow you to specify an actual key or initialization vector (IV). It only lets you specify data to be used to derive a key and uses a static IV. ... Edited July 2 by TheXman quickbeam 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
quickbeam Posted July 2 Author Posted July 2 That does indeed look like what I want. I also noticed that the current library uses the deprecated DLL, which was a little concerning. Okay, I downloaded it. Wow, that's not a little weekend project you did! The help pages are coming up blank, but it's probably a security issue on our end, I'll investigate.
TheXman Posted July 2 Posted July 2 24 minutes ago, quickbeam said: The help pages are coming up blank The most common resolution to that problem is to unblock the chm file. CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
quickbeam Posted July 2 Author Posted July 2 It was probably similar. It would prompt me each time I opened it if I trusted it. I would say yes, but the help window came up blank. Eventually I clicked a checkbox to not ask the question again, and that time it worked. Unintuitively, the checkbox probably unblocked the file instead of answering yes.
rudi Posted July 23 Posted July 23 Hello, you could do an external call of a powershell script, in case the very nice UDF by @TheXman should have issues, as mentioned. This might be a start to do so: https://stackoverflow.com/questions/75340972/how-to-aes-decrypt-a-string-in-powershell-with-a-given-iv-and-key-as-string Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now