Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshua-riek/des
My implementation of the Data Encryption Standard (DES)!
https://github.com/joshua-riek/des
algorithm algorithms decryption des encryption python security
Last synced: 2 days ago
JSON representation
My implementation of the Data Encryption Standard (DES)!
- Host: GitHub
- URL: https://github.com/joshua-riek/des
- Owner: Joshua-Riek
- License: gpl-3.0
- Created: 2022-10-24T20:43:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-29T23:50:54.000Z (about 2 years ago)
- Last Synced: 2024-12-16T08:11:09.311Z (6 days ago)
- Topics: algorithm, algorithms, decryption, des, encryption, python, security
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## DES
This is my implementation of the Data Encryption Standard (DES), a symmetric-key block cipher published by the National Institute of Standards and Technology (NIST).
Encryption: `C = E(K1, P)`
Decryption: `P = D(K1, C)`
```Python
# A simple example of encrypting a string with DES!key = 0x133457799bbcdff1
des = DES(key)
cyphertext = des.encrypt('Hello World!', key)
plaintext = des.decrypt(cyphertext, key)
```## Triple DES
Triple DES (3DES or TDES) is a symmetric-key block cipher, which applies the DES cipher algorithm three times to each data block.Encryption: `C = E(K3, D(k2, E(K1, P)))`
Decryption: `P = D(K1, E(K2, D(K3, C)))`
```Python
# A simple example of encrypting bytes with Triple DES!key1 = 0x133457799bbcdff1
key2 = 0x0123456789abcdef
key3 = 0xfedcba9876543210des = TripleDES(key1, key2, key3)
cyphertext = des.encrypt(b'Hello World!')
plaintext = des.decrypt(cyphertext)
```