In [ ]:
key = "YELLOW SUBMARINE";

In [ ]:
function stringToBytes(X::String)
    return [UInt8(X[ii]) for ii in 1:length(X)]
end;

In [ ]:
keybytes = stringToBytes(key);

In [ ]:
keyhex = bytes2hex(keybytes);

this is a lame way to do this, but it seems julia doesn't currently have good openssl bindings


In [ ]:
function decryptAES128ECBFileWithKey(fname, key)
    decrypt = chomp(readstring(`openssl enc -d -a -aes-128-ecb -K $key -in $fname`))
    return decrypt
end;

In [ ]:
pt = decryptAES128ECBFileWithKey("7.txt", keyhex);

In [ ]:
println(pt)