/crypto

Encryption and Decryption codes transform plaintext in some way that is dependent on a key, producing ciphertext using by Python3.

Primary LanguagePythonMIT LicenseMIT

Cipher

Encryption and Decryption codes transform plaintext in some way that is dependent on a key, producing ciphertext using by Python3.

Requirements

PyCrypto

How to use

Before you encryption or decrytion something, must know two important values.

  1. Key: String, continous string values like password that will be converted by UTF-8
  2. Initial Vector: String, 16 numbers [0-9]{16}$ and wrap it with type of string
(example)
key = 'password1234~!@#$something'
iv = '1234567890123456'

Encryption

from cipher.crypto import Cipher

data = 'Something you want to encrypt'
enc = Cipher(key, iv)
result = enc.encryption(data)

Decryption

from cipher.crypto import Cipher

data = 'Something you want to decrypt'
dec = Cipher(key, iv)
result = dec.decryption(data)