aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/examples/cryptobox.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/examples/cryptobox.py')
-rwxr-xr-xsrc/scripts/examples/cryptobox.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/scripts/examples/cryptobox.py b/src/scripts/examples/cryptobox.py
deleted file mode 100755
index f76ed6bc3..000000000
--- a/src/scripts/examples/cryptobox.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import botan
-
-def main(args = None):
- if args is None:
- args = sys.argv
-
- if len(args) != 3:
- raise Exception("Usage: <password> <input>");
-
- password = args[1]
- input = ''.join(open(args[2]).readlines())
-
- rng = botan.RandomNumberGenerator()
-
- ciphertext = botan.cryptobox_encrypt(input, password, rng)
-
- print ciphertext
-
- plaintext = ''
-
- try:
- plaintext = botan.cryptobox_decrypt(ciphertext, password + 'FAIL')
- except Exception, e:
- print "Good news: bad password caused exception: "
- print e
-
- plaintext = botan.cryptobox_decrypt(ciphertext, password)
-
- print "Original input was: "
- print plaintext
-
-if __name__ == '__main__':
- sys.exit(main())