I'm looking for a good permissive-licensed (BSD/MIT or PD) DES implementation in C, with minimal runtime memory usage (i.e. minimal amount of read-write memory, and preferably small code/table size too). Speed is not an issue; in fact, in some ways slower is better because it provides some natural defense against brute-force login attempts.
All of the traditional implementations I've seen do lazy/runtime initialization of huge tables, which is what I'm trying to avoid. I'd be happy to have the tables in static const data in the binary, and in fact this is what I've partly hacked onto an implementation I've got right now, but I'm wondering if there are any existing implementations that do a better job of minimizing the size of tables at the expense of performance so that the binary isn't so big (~50kb of tables).
Note: Yes, DES sucks. The intended usage case is for implementing the crypt function for handling traditional password logins.
An example with MIT license and the version from libtomcrypt is completely free for all purposes.
The first version seems to do lazy initialization of the tables, too, whereas they are static consts in libtomcrypt. But libtomcrypt seems to give you a compilation flag for speed vs. size, there's a #ifndef LTC_SMALL_CODE in front of the larger tables, maybe that can solve your problem?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With