Skip to content

Commit

Permalink
Was never gonna encrypt anything anyway 馃槬
Browse files Browse the repository at this point in the history
  • Loading branch information
stewartmcgown committed Dec 4, 2018
1 parent 2f324c6 commit 969cd71
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions Encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
import os
import base64

def encrypt(chunk):
backend = default_backend()
key = os.urandom(32)
iv = os.urandom(16)
cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=backend)
encryptor = cipher.encryptor()
ct = encryptor.update(b"a secret message") + encryptor.finalize()
return ct

def decrypt(chunk):
decryptor = cipher.decryptor()
decryptor.update(ct) + decryptor.finalize()

def encode(chunk):
enc = base64.b64encode(chunk).decode()
return enc
Expand Down

0 comments on commit 969cd71

Please sign in to comment.