This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
# Don't use this | |
module Encryption | |
def self.cipher(mode) | |
cipher = OpenSSL::Cipher::Cipher.new("aes-256-ecb") | |
cipher.send mode | |
cipher.key = "ABANDON ALL HOPE YE WHO USE ECB!" | |
cipher.padding = 0 | |
cipher |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Simple chosen-plaintext attack on AES-CTR given NONCE and IV re-use for | |
multiple ciphertexts | |
Copyleft 2011 Ian Gallagher <[email protected]> | |
""" | |
import sys | |
def decrypt(keystream, ciphertext): |