jueves, 23 de agosto de 2012

One time pad - Python

For this introductory assignment, we have to do a one time pad program, I did it in python. 

"In cryptography, the one-time pad (OTP) is a type of encryption which has been proven to be impossible to crack if used correctly. Each bit or character from the plaintext is encrypted by a modular addition with a bit or character from a secret random key (or pad) of the same length as the plaintext, resulting in a ciphertext."

This method can be implemented as a software program, using data files as input (plaintext), output (ciphertext) and key material. The XOR operation is often used to combine the plaintext with the key. 

This is my code, it is very simple.



1 comentario:

  1. Está bien chistoso el método para generar claves. Para que haga lo que tú pareces querer, pon al inicio mejor que a = '0', pero en sí lo que haces es bien sonso, nena. Mejor has que la clave comience siendo '' y le agregas dígitos al azar, pero esto limita el alfabeto posible a un total de 9 caracteres (más espacio). Van 2 puntos por el intento.