blob: 24c7f6eab83bd2437566c5770ee00a1f26e1b408 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/usr/bin/python
import sys, botan
def do_hash(input):
cipher_key = botan.SymmetricKey("AABB")
pipe = botan.Pipe(botan.Filter("Blowfish/CBC/PKCS7",
key = botan.SymmetricKey("AABB"),
iv = botan.InitializationVector("AABBCCDDEEFF0011"),
dir = botan.cipher_dir.encryption),
botan.Filter("Hex_Encoder"))
pipe.start_msg()
pipe.write(input)
pipe.end_msg()
return pipe.read_all_as_string()
def main():
print do_hash("hi chappy")
if __name__ == "__main__":
sys.exit(main())
|