ddn.crypto.legacy.cipher.des

DES Block Cipher (FIPS 46-3).

WARNING: DEPRECATED ALGORITHM

DES is cryptographically broken due to its 56-bit key size, which is vulnerable to brute-force attacks. It is provided only for backward compatibility with legacy systems that require it, primarily as a building block for Triple DES (3DES).

Do NOT use DES for new encryption. Use AES-256 instead.

Standards

FIPS 46-3 (withdrawn 2005), NIST SP 800-67
class DES

Types 1

DES block cipher implementation (FIPS 46-3).

DEPRECATED: Do not use for new encryption.

DES encrypts 64-bit blocks using a 56-bit key (stored in 8 bytes with parity bits). This implementation is provided for legacy compatibility, primarily as a building block for Triple DES.

Example:

auto des = new DES(key);  // 8-byte key
ubyte[8] ciphertext;
des.encrypt(plaintext, ciphertext);

Methods
size_t blockSize() @property const @safe pure nothrow @nogcReturns: The block size in bytes (always 8 for DES).
void encrypt(const(ubyte)[] input, ubyte[] output)Encrypts a single 8-byte block.
void decrypt(const(ubyte)[] input, ubyte[] output)Decrypts a single 8-byte block.
Constructors
this(const(ubyte)[] key)Constructs a DES cipher with the given key.