1. AES Encryption

How do we do AES encryption with Euphoria? (Unfortunately, Search provides no good links.)

new topic     » topic index » view message » categorize

2. Re: AES Encryption

euphoric said...

How do we do AES encryption with Euphoria? (Unfortunately, Search provides no good links.)

You need a library like "Microsoft CryptoAPI".

If I remember correctly, encryption methods will be implemented in OE 4.2.

new topic     » goto parent     » topic index » view message » categorize

3. Re: AES Encryption

euphoric said...

How do we do AES encryption with Euphoria? (Unfortunately, Search provides no good links.)

Best bet is probably to wrap libtomcrypt.

-Greg

new topic     » goto parent     » topic index » view message » categorize

4. Re: AES Encryption

ghaberek said...
euphoric said...

How do we do AES encryption with Euphoria? (Unfortunately, Search provides no good links.)

Best bet is probably to wrap libtomcrypt.

-Greg

I wouldn't mind taking a stab at trying to wrap these libtom libraries. However when I tried compiling/building themselves, I ran into issues. If someone wants to send me the DLLs, I'll take a crack at it. I might try building these under Linux using the Windows Linux Subsystem as these libraries appear to be developed under a linux environment.

new topic     » goto parent     » topic index » view message » categorize

5. Re: AES Encryption

Isn't there some sort of built-in or standard lib encryption for Euphoria already?

new topic     » goto parent     » topic index » view message » categorize

6. Re: AES Encryption

euphoric said...

Isn't there some sort of built-in or standard lib encryption for Euphoria already?

You would think that, but no. Encryption isn't something you want to implement from scratch; I'd feel more confident bundling something already well tested, like libtomcrypt or similar. You're welcome to lead that project if you'd like.

-Greg

new topic     » goto parent     » topic index » view message » categorize

7. Re: AES Encryption

ghaberek said...

Encryption isn't something you want to implement from scratch; I'd feel more confident bundling something already well tested, like libtomcrypt or similar.

Maybe one of these will work: Euphoria Encryption Libs

new topic     » goto parent     » topic index » view message » categorize

8. Re: AES Encryption

euphoric said...

Maybe one of these will work: Euphoria Encryption Libs

If you want to call what you're doing "encryption" then those are not the answer. Encryption has come a long way in the last twenty years and it would be unwise to use anything that isn't well tested, supported, and maintained. The Archive, by the way, should really be regarded as "for informational purposes only" as anything that is hand-made and purports to be "secure" is likely not. Plus, you started this thread asking specifically for AES encryption which none of those are anyway. The closest is Blowfish but even that is outdated and not at all compatible with AES. Here is a thread from Stack Exchange that explains the nuance and difficulty involved: Why shouldn't we roll our own?

-Greg

new topic     » goto parent     » topic index » view message » categorize

9. Re: AES Encryption

Well vcPkg has a libtomcrypt package. However it only compiles as a .lib file. I looked into Microsoft Seal, but its very C Plus Plus codebase. What about OpenSSL? Or is that not have AES Encryption or is OpenSSL bigger than what is needed?

new topic     » goto parent     » topic index » view message » categorize

10. Re: AES Encryption

Icy_Viking said...

Well vcPkg has a libtomcrypt package. However it only compiles as a .lib file. I looked into Microsoft Seal, but its very C Plus Plus codebase.

Building libtomcrypt on Windows is pretty simple but there are a few small caveats. libtomcrypt.dll depends on libtommath.dll so you need to build that first. The makefile for libtomcrypt is specifically looking for ../libtommath and you can technically override this but it's easier to just rename the directories after you extract them. Just make sure they're next to each other. Probably not an issue if you're cloning the repo from GitHub instead of using the zip files.

Here are the steps I used to build both libraries:

tdm-gcc

  1. Install TDM-GCC 10.3.0 first if you don't have it already

libtommath

  1. Download and extract ltm-1.2.0.zip
  2. Rename libtommath-1.2.0 to simply libtommath
  3. cd libtommath and build the library:

    mingw32-make -f makefile.mingw -j4 libtommath.dll

libtomcrypt

  1. Download and extract crypt-1.18.2.zip
  2. Rename libtomcrypt-1.18.2 to simply libtomcrypt
  3. cd libtomcrypt and build the library:

    mingw32-make -f makefile.mingw -j4 libtomcrypt.dll

Icy_Viking said...

What about OpenSSL? Or is that not have AES Encryption or is OpenSSL bigger than what is needed?

OpenSSL, as its name suggests, is primarily build to provide encrypted networking via SSL and TLS. But it only provides the encryption later and not the protocols running inside. LibCURL provides most of that on top of OpenSSL. Using OpenSSL for only its encryption features is overkill and libtomcrypt is a much simpler option.

-Greg

new topic     » goto parent     » topic index » view message » categorize

11. Re: AES Encryption

Thanks Greg. I was able to get libtommath to build. However when I try to build libtomcrypt, it says it can't find -ltommath. collect2.exe: error ld return 1 exit status. I put the directories next to each other.

EDIT: After putting libtomcrypt and libtommath next to each other in the same directory, I got it to build. Thanks Greg.

new topic     » goto parent     » topic index » view message » categorize

12. Re: AES Encryption

ghaberek said...

If you want to call what you're doing "encryption" then those are not the answer...

Your case is, of course, compelling, but you are a professional, so nothing less is expected. grin

There's no way in heck I would ever deign to roll my own. That's a time-wasting disaster waiting to happen!

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu