Expand description
Data Encryption Standard (DES) and Triple DES implementations.
These algorithms are retained for compatibility with legacy protocols and are not suitable for new designs.
§Choosing an engine
DesEngine and DesEdeEngine pick an engine at compile time: the
RustCrypto engines when the rustcrypto Cargo feature is enabled,
otherwise DesTableEngine and DesEdeTableEngine. Every engine is
variable time, since each looks up S-boxes with secret data; the RustCrypto
engines narrow the cache-timing channel with smaller S-boxes and a
branch-free key schedule. For explicit selection, DesRustCryptoEngine and
DesEdeRustCryptoEngine are available with the rustcrypto feature.
Structs§
- DesEde
Engine - EDE Triple DES on the least leaky engine the build provides:
DesEdeRustCryptoEnginewhen therustcryptofeature is on, otherwiseDesEdeTableEngine. The choice is made at compile time; the type and its API are the same under every configuration. - DesEde
Rust Crypto Engine - EDE Triple DES backed by RustCrypto’s
descrate, with a 16-byte or 24-byte encoded key and an 8-byte block. - DesEde
Table Engine - EDE Triple DES with a 16-byte or 24-byte encoded key and an 8-byte block,
using the same SP-box tables as
DesTableEngine. - DesEngine
- DES on the least leaky engine the build provides:
DesRustCryptoEnginewhen therustcryptofeature is on, otherwiseDesTableEngine. The choice is made at compile time; the type and its API are the same under every configuration. - DesRust
Crypto Engine - DES backed by RustCrypto’s
descrate, with an 8-byte encoded key and an 8-byte block. - DesTable
Engine - DES with an 8-byte encoded key and an 8-byte block, using eight 256-byte SP-box tables that combine each S-box with the P permutation.
Constants§
- BLOCK_
BYTES - DES and Triple DES block length in bytes.
- DES_
ALGO_ NAME - Algorithm name returned by every DES engine’s
Displayimplementation. - DES_
EDE_ ALGO_ NAME - Algorithm name returned by every Triple DES engine’s
Displayimplementation. - DES_
EDE_ KEY_ BYTES - Accepted Triple DES key lengths in bytes.
- DES_
KEY_ BYTES - Accepted DES key lengths in bytes: 64 encoded bits, 56 of them effective.
- EDE2_
KEY_ BYTES - Encoded key length for two-key Triple DES (
K1, K2, K1). - EDE3_
KEY_ BYTES - Encoded key length for three-key Triple DES (
K1, K2, K3).