@@ -0,0 +1,1415 @@
+#!/usr/bin/env python3%0A%0A__author__ = %22JR. Lambea%22%0A__copyright__ = %22Copyright 2015%22%0A__credits__ = %5B%22JR. Lambea%22%5D%0A__license__ = %22GPL%22%0A__version__ = %221.0.0%22%0A__maintainer__ = %22JR. Lambea%22%0A__email__ = %22jr.lambea@yahoo.com%22%0A__status__ = %22%22%0A%0Aimport sys%0Aimport argparse%0A%0Adef validate_key (key):%0A%0A%09c = len(key)%0A%0A%09for i in range(c):%0A%09%09if str(i) not in key:%0A%09%09%09return False%0A%0A%09return True%0A%0Adef print_block (block, key):%0A%0A%09for c in range(len(block)):%0A%09%09print (%22%25c%22 %25 block%5Bint(key%5Bc%5D)%5D, end = %22%22)%0A%0Adef main ():%0A%0A%09parser = argparse.ArgumentParser()%0A%09parser.add_argument (%22text%22, help = %22Message to encrypt/decrypt%22, type = str)%0A%09parser.add_argument (%22key%22, help = %22Key to do the encryption%22, type = str)%0A%09parser.add_argument (%22-p%22, %22--padding-character%22, help = %22Key to do the encryption%22, type = str, default = %22 %22)%0A%09parser.add_argument (%22-r%22, %22--remove-spaces%22, help = %22Avoid the spaces.%22, action = %22count%22, default = 0)%0A%09args = parser.parse_args()%0A%0A%09key = args.key.split(%22,%22)%0A%09count = len(key)%0A%09block = %22%22%0A%0A%09if args.remove_spaces %3E 0:%0A%09%09text = args.text.replace(%22 %22, %22%22)%0A%09else:%0A%09%09text = args.text%0A%0A%09if not validate_key (key):%0A%09%09print (%22The key is invalid%22)%0A%09%09sys.exit (5)%0A%0A%09for i in range(len(text) %25 len(key)):%0A%09%09text += args.padding_character%0A%0A%09for c in text:%0A%09%09block += c%0A%09%09%0A%09%09if len(block) == len(key):%0A%09%09%09print_block (block, key)%0A%09%09%09print (%22 %22, end = %22%22)%0A%09%09%09block = %22%22%0A%09%09%0A%09print ()%0A%0Aif __name__ == %22__main__%22:%0A    main()%0A

Create blocktrans.py