aboutsummaryrefslogtreecommitdiffstats
path: root/misc/python/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'misc/python/test.py')
-rwxr-xr-xmisc/python/test.py35
1 files changed, 7 insertions, 28 deletions
diff --git a/misc/python/test.py b/misc/python/test.py
index 9896777d4..20c2a9119 100755
--- a/misc/python/test.py
+++ b/misc/python/test.py
@@ -2,36 +2,15 @@
import sys, botan
-def encrypt(input):
- cipher_key = botan.SymmetricKey("AABB")
- print cipher_key.length
- cipher_key = botan.SymmetricKey("AABBCCDD")
- print cipher_key.length
-
- cipher = botan.Filter("ARC4", key = cipher_key)
-
- pipe = botan.Pipe(cipher, botan.Filter("Hex_Encoder"))
-
- pipe.start_msg()
- pipe.write(input)
- pipe.end_msg()
-
- str = pipe.read_all()
- print str
- return str
-
-def decrypt(input):
- pipe = botan.Pipe(botan.Filter("Hex_Decoder"),
- botan.Filter("ARC4",
- key = botan.SymmetricKey("AABBCCDD")))
-
- pipe.process_msg(input)
- return pipe.read_all()
+class PyAlgo(botan.Algorithm):
+ def name(self):
+ return "PyAlgo"
+ def clear(self):
+ print "clearing"
def main():
- ciphertext = encrypt("hi chappy")
- print ciphertext
- print decrypt(ciphertext)
+ alg = PyAlgo()
+ botan.print_algo(alg)
if __name__ == "__main__":
sys.exit(main())