domingo, 17 de agosto de 2014

One Time Pad


ONE TIME PAD

For the first assignment we created a one time pad.

A one-time-pad is a technique where a plaintext is paired with a random secret key.

In this case we generate a random key and we paired it with the message using the xor operator.

This is the function I use to generate and write the random keys into a file:


We use one function to decrypt an encrypt our messages:

Example:

In this example we will encrypt the text "SecretMessage". so we need to generate a key of lenght 13.

This command will create a new file called "keys" with our mew key. Now that we have our key we can create our ciphertext:

Now that we have our ciphertext on a file called "messages" the only way to recover the message is by using the same key we use to encrypt the message.

NOTE: This command will also erase the key from the "key" file to ensure we use a key only once
full code at: https://github.com/saflogar/OTP

3 comentarios:

  1. No pongas archivos respaldo en el repo (tipo algo~ o #algo#).
    Agrega todas las fuentes consultadas en una bibliografía al final. (Citas estilo wikipedia con números estaría lo ideal.9

    Regreso aquí el jueves siguiente para calificar la tarea.

    ResponderEliminar
  2. + Control over key length as a parameter: ok
    + Control over the number of keys as a parameter: ok
    + Automatic key management: mentioned, not shown (1/2)
    + Functional encryption/decryption: symmetric
    + Adequate use cases for example runs: screenshots of text in a terminal... (1/2)
    - Spelling: ok
    - Grammar: inconsistent use of past and present tenses
    - Structure and visual design of the report: ok
    - Reference management: entirely absent (-1)
    - Programming style: ok, but you should comment more
    x English: check
    => 3 out of 5 pts

    ResponderEliminar