Skip to content

Latest commit

 

History

History
74 lines (51 loc) · 2.23 KB

File metadata and controls

74 lines (51 loc) · 2.23 KB

Block Cipher Modes Of Operation


Version License Tests Language

Please read Further Informations before using the provided code!


Description

The Block Cipher Modes of Operation belongs to the group of symmetric cryptography.

They can be used to encrypt data with a key and, depending on the mode, also with other parameters.

Example Implementation

#Encrpytion and decryption using CBC
from encryption_modes import cbc_encryption
from decryption_modes import cbc_decryption
from Essentials.converter import hex_to_ascii

encrypted = cbc_encryption("Plaintext", "Key", 0, 3)

print(encrypted)
print(hex_to_ascii(encrypted))

decrypted = cbc_decryption(
    hex_to_ascii(encrypted), "Key", 0, 3, True
)

print(decrypted)
-------------- CONSOLE OUTPUT ---------------
    >> 1B0918390215171F18
    >> �	�9�����
    >> Plaintext

Python requirements

None ---

Using this implementation

To use the provided methods, just clone the source code via GitHub and start implementing it in youre own programs.

The provided code supports the file Example.py with predefined example implementations.


Further information

This is just an implementation of the Block Cipher Modes of Operation.

Do not under any circumstances use this for any encryption of actual important information nor vulnerable data nor send or stored data in general!

The provided methods do not guarantee a safe and flawless encryption of the data and are therefore meant for experimental and learning purposes only!

Please use other encryption librarys with proven correctness for encrypting youre data!

Never roll your own crypto


Miscellaneous

If you have any other modes you want to be implemented or there are any errors, please feel free to fix them yourself or contact me! 🔥