No description
Find a file
2019-09-24 11:10:09 +01:00
des minor changes to avoid module not used warnings 2019-09-24 11:10:09 +01:00
tests nim 1.0.0: discarding high nibble by casting errors. Use the 'and' bit operation to explicitly truncate 2019-09-24 11:05:42 +01:00
.gitignore discarded unused bin buffers; migrated bin utils API; bin documentation tidy-up 2019-08-27 17:48:22 +01:00
.travis.yml travis via choosenim; tests via nimble 2019-08-30 13:30:52 +01:00
des.nimble minor changes to avoid module not used warnings 2019-09-24 11:10:09 +01:00
LICENSE Create LICENSE 2016-07-18 20:38:32 +01:00
README.md Generics for input data parameter of DES ops. 2018-09-05 13:28:34 +01:00

des.nim

Build Status

About

This is a Nim port of a C-based DES implementation. It implements single, double and triple DES operations with support for basic data padding. DUKPT simple key management (PEK is cached, not holding the future keys array) with encrypt/decrypt and MAC operations also supported.

Examples

Refer to the test folder for how to DES crypt/decrypt and DUKPT current key(s) derivation.

Notes

  • only the mostly used CBC and ECB modes are implemented. Nowadays, ECB is only useful as an internal helper routine, do not encode your data that way.
  • pay attention to resetting the IV when starting a different logical operation (IV is cached to allow manual chaining)
  • all operations are based on complete input data. For streams, your may want to enhance or build atop the existing implementation. The last processed block may require special handling (see MAC X9.19)

Future

None. All desired operations are now supported. (low priority: perhaps incrementing the internal KSN field and deriving the keys based on it)

Credits

Thanks to the libtomcrypt authors on whose work this library is based.