Expand description
various symmetric-key algorithms for the encryption/decryption of digital data
§Introduction
The module that contains a few sub-modules to define symmetric-key algorithms for the encryption/decryption of digital data
§Background: Symmetric encryption/decryption algorithms
There are two caregories in encryption/decryption algorithms: Symmetric-Key cryptographic algorithms and Asymmetric-Key cryptographic algorithms. The Symmetric-Key cryptographic algorithms use the same keys to encrypt and to decrypt, and are way faster than the Symmetric-Key cryptographic algorithms. This module implements a few Symmetric-Key cryptographic algorithms in Rust codes.
Read this article and/or Watch this lecture to learn symmetric encryption/decryption algorithms more in detail.
§The symmetric-key algorithms for the encryption/decryption of digital data
This module provides several kinds of symmetric-key algorithms for the encryption/decryption of digital data:
- AES and Rijndael symmetric-key encryption/decryption algorithm and the
trait implementations of Operation modes and padding bits for AES_Generic
— Includes AES and its expanded versions, and ECB, CBC, PCBC, CFB, OFB,
and CTR modes, and padding bits according to PKCS#7 and ISO 7816-4.
Rijndael_Generic,ECB_PKCS7,ECB_ISO,CBC_PKCS7,CBC_ISO,PCBC_PKCS7,PCBC_ISO,CFB,OFB, andCTR. - DES symmetric-key encryption/decryption algorithm and the traits and
its implementations of Operation modes and padding bits for DES_Generic
— Includes DES and its expanded versions, and ECB, CBC, PCBC, CFB, OFB,
and CTR modes, and padding bits according to PKCS#7 and ISO 7816-4.
DES_Generic,ECB_PKCS7,ECB_ISO,CBC_PKCS7,CBC_ISO,PCBC_PKCS7,PCBC_ISO,CFB,OFB, andCTR. - BigCryptor128 combinations of symmetric-key encryption/decryption
algorithms and the trait implementations of Operation modes and padding
bits for BigCryptor128
— Includes 2AES, 3AES, 4AES, etc., and their expanded versions, and ECB,
CBC, PCBC, CFB, OFB, and CTR modes, and padding bits according to PKCS#7
and ISO 7816-4.
BigCryptor128ECB_PKCS7,ECB_ISO,CBC_PKCS7,CBC_ISO,PCBC_PKCS7,PCBC_ISO,CFB,OFB, andCTR. However, it is considered that 2AES, 3AES, 4AES, etc. are not very meaningful because AES-256, Rijndael_128_384, Rijndael_128_512, etc. are considered to be better than 2AES, 3AES, 4AES, etc. - BigCryptor64 combinations of symmetric-key encryption/decryption
algorithms and the trait implementations of Operation modes and padding
bits for BigCryptor64
— Includes 2DES, 3DES, 4DES, etc., and their expanded versions, and
ECB, CBC, PCBC, CFB, OFB, and CTR modes, and padding bits according to
PKCS#7 and ISO 7816-4.
BigCryptor64BigCryptor128ECB_PKCS7,ECB_ISO,CBC_PKCS7,CBC_ISO,PCBC_PKCS7,PCBC_ISO,CFB,OFB, andCTR.
§QUICK START
Modules§
- documentation
- des.rs was too big because of documentation and plenty of examples
So, in order to provide documentation without
docs.rs’s failing generating documentation, dummy codes were made and documentation and examples were moved to all the *.rs in documentation folder.
Structs§
- BigCryptor64
- A BigCryptor64 wrapper struct for cascading encryption/decryption algorithms that has 64-bit block size
- BigCryptor128
- A BigCryptor128 wrapper struct for cascading encryption/decryption algorithms that has 128-bit block size
- DDES
- struct that generates BigCryptor64 with two DES objects
- DES_
Generic - A DES symmetric-key algorithm for the encryption of digital data
- Rijndael_
Generic - A Rijndael or AES (Advanced Encryption Standard) symmetric-key algorithm for the encryption of digital data
- TDES
- struct that generates BigCryptor64 with three DES objects
Traits§
- CBC_ISO
- CBC (Cipher-Block Chaining) is one of the operation modes for encryption/decryption. And ISO 7816-4 is the one of the padding ways.
- CBC_
PKCS7 - CBC (Cipher-Block Chaining) is one of the operation modes for encryption/decryption. And PKCS #7 is the one of the padding ways.
- CFB
- CFB (Cipher FeedBack) is one of the operation modes for encryption/decryption.
- CTR
- CTR (CounTeR) is one of the operation modes for encryption/decryption.
- ECB_ISO
- ECB (Electronic CodeBook) is one of the operation modes for encryption/decryption. And ISO 7816-4 is the one of the padding ways.
- ECB_
PKCS7 - ECB (Electronic CodeBook) is one of the operation modes for encryption/decryption. And PKCS #7 is the one of the padding ways.
- OFB
- OFB (Output FeedBack) is one of the operation modes for encryption/decryption.
- PCBC_
ISO - PCBC (Propagation Cipher-Block Chaining) is one of the operation modes for encryption/decryption. And ISO 7816-4 is the one of the padding ways.
- PCBC_
PKCS7 - PCBC (Propagation Cipher-Block Chaining) is one of the operation modes forencryption/decryption. And PKCS #7 is the one of the padding ways.
- Small
Cryptor - SmallCryptor<u64, 8> and SmallCryptor<u128, 16> are the traits for the components for BigCryptor128 and BigCryptor64, respectively.
Type Aliases§
- AES_128
- AES_128 is one of AES series. Its key is 128-bit and its encryption block is 128-bit. It is the same as the Rijndael_128_128.
- AES_192
- AES_192 is one of AES series. Its key is 192-bit and its encryption block is 128-bit. It is the same as the Rijndael_128_192.
- AES_256
- AES_256 is one of AES series. Its key is 256-bit and its encryption block is 128-bit. It is the same as the Rijndael_128_256.
- DES
- The official DES symmetric-key algorithm for the encryption of digital data If you want to use the official DES algorithm, the type DES is for you.
- DES_
Expanded - You have freedom of changing ROUND and SHIFT. You can change the DES
algorithm by simply changing the generic parameters
ROUNDandSHIFTwithout touching the source code itself. - DES_F
- You have freedom of changing EP01 ~ EP48, TP01 ~ TP32, and S000 ~ S763. You can change the DES algorithm by simply changing the generic parameters
- DES_
Round Key - You have freedom of changing SHIFT, and PC101 ~ PC248.
You can change the DES algorithm by simply changing the generic parameters
SHIFT, and PC101 ~ PC248 without touching the source code itself. - Rijndael_
32_ 32 - Rijndael_32_32 is not really practical but only educational to understand AES or Rijndael cryptographic algorithm. Its key is 32-bit and its encryption block is 32-bit.
- Rijndael_
64_ 64 - Rijndael_64_64 is not really practical too, but it can be used with DES cryptographic algorithm along or as random number generator engine. Its key is 64-bit and its encryption block is 64-bit. So, it can work with DES.
- Rijndael_
128_ 128 - Rijndael_128_128 is one of Rijndael series. Its key is 128-bit and its encryption block is 128-bit. It is the same as the AES_128.
- Rijndael_
128_ 192 - Rijndael_128_192 is one of Rijndael series. Its key is 192-bit and its encryption block is 128-bit. It is the same as the AES_192.
- Rijndael_
128_ 256 - Rijndael_128_256 is one of Rijndael series. Its key is 256-bit and its encryption block is 128-bit. It is the same as the AES_256.
- Rijndael_
128_ 384 - Rijndael_128_384 is one of Rijndael series. Its key is 384-bit and its encryption block is 128-bit.
- Rijndael_
128_ 512 - Rijndael_128_512 can be used as one of post-Quantum algorithms for a while because even Grover algorithm takes long enough to break Rijndael_128_512. Its key is 512-bit and its encryption block is 128-bit.
- Rijndael_
192_ 128 - Rijndael_256_128 is one of Rijndael series. Its key is 128-bit and its encryption block is 192-bit.
- Rijndael_
192_ 192 - Rijndael_192_192 is one of Rijndael series. Its key is 192-bit and its encryption block is 192-bit.
- Rijndael_
192_ 256 - Rijndael_192_256 is one of Rijndael series. Its key is 256-bit and its encryption block is 192-bit.
- Rijndael_
192_ 384 - Rijndael_192_384 is one of Rijndael series. Its key is 384-bit and its encryption block is 192-bit.
- Rijndael_
192_ 512 - Rijndael_192_512 can be used as one of post-Quantum algorithms for a while because even Grover algorithm takes long enough to break Rijndael_192_512. Its key is 512-bit and its encryption block is 192-bit.
- Rijndael_
256_ 128 - Rijndael_256_128 is one of Rijndael series. Its key is 128-bit and its encryption block is 256-bit.
- Rijndael_
256_ 192 - Rijndael_256_192 is one of Rijndael series. Its key is 192-bit and its encryption block is 256-bit.
- Rijndael_
256_ 256 - Rijndael_256_256 is one of Rijndael series. Its key is 256-bit and its encryption block is 256-bit.
- Rijndael_
256_ 384 - Rijndael_256_384 is one of Rijndael series. Its key is 384-bit and its encryption block is 256-bit.
- Rijndael_
256_ 512 - Rijndael_256_512 can be used as one of post-Quantum algorithms for a while because even Grover algorithm takes long enough to break Rijndael_256_512. Its key is 512-bit and its encryption block is 256-bit.
- Rijndael_
384_ 128 - Rijndael_384_128 is one of Rijndael series. Its key is 128-bit and its encryption block is 384-bit.
- Rijndael_
384_ 192 - Rijndael_384_192 is one of Rijndael series. Its key is 192-bit and its encryption block is 384-bit.
- Rijndael_
384_ 256 - Rijndael_384_256 is one of Rijndael series. Its key is 256-bit and its encryption block is 384-bit.
- Rijndael_
384_ 384 - Rijndael_384_384 is one of Rijndael series. Its key is 384-bit and its encryption block is 384-bit.
- Rijndael_
384_ 512 - Rijndael_384_512 can be used as one of post-Quantum algorithms for a while because even Grover algorithm takes long enough to break Rijndael_384_512. Its key is 512-bit and its encryption block is 384-bit.
- Rijndael_
512_ 128 - Rijndael_512_128 is one of Rijndael series. Its key is 128-bit and its encryption block is 512-bit.
- Rijndael_
512_ 192 - Rijndael_384_192 is one of Rijndael series. Its key is 192-bit and its encryption block is 512-bit.
- Rijndael_
512_ 256 - Rijndael_384_256 is one of Rijndael series. Its key is 256-bit and its encryption block is 512-bit.
- Rijndael_
512_ 384 - Rijndael_512_384 is one of Rijndael series. Its key is 384-bit and its encryption block is 512-bit.
- Rijndael_
512_ 512 - Rijndael_512_512 can be used as one of post-Quantum algorithms for a while because even Grover algorithm takes long enough to break Rijndael_512_512. Its key is 512-bit and its encryption block is 512-bit.