Tag Archives: Cripto

Cryptography – Part II

Machine cryptography

Since entering the nineteenth century, great minds and developments in technology allow for developments in cryptography a great example is the Morse Code which was developed by Alfred Vail who worked with Samuel Morse and this code was transmitted by telegraph double (Thomas Alva Edison), which allowed to transmit an electrical impulse to a significant distance by a power line, But really that was the Morse Code? their interpretation is very simple to each letter was assigned a binary symbol say because only two types were used “.” and “-” being something.

 

and how to enter these symbols is through down while maintaining electrical contact. -

Already in the twentieth century telegraphs were replaced by radio signals, providing possibility of transmission in May and likewise offering the possibility of intercepting those signals, so one of the most important developments in cryptography occurred during the War the World Famous “Zimmermann Telegram” was under the same encryption known to Germans as “ADFGVX” which was used by the Germans to convey their messages securely diplomats, this type of encryption is the type substitution and transposition the code table being something like the following example:

A

D

F

G

V

X

A

b

o

g

r

0

e

D

v

1

9

i

z

q

F

4

d

x

t

l

m

G

h

u

8

5

c

3

V

6

y

k

n

f

p

X

j

s

7

2

w

a

 The table consists of 36 cells where they attach letters of the alphabet plus the 10 numbers and the first row and first column is the number ADFGVX mode is very simple encrypt the letter seeks to encrypt and put the value of corresponds to its row and column, let an example, let’s encrypt “mkit Argentina.” -

m

k

i

t

a

r

g

e

n

t

i

n

a

XF

FV

GD

GF

XX

GA

FA

XA

GV

GF

GD

GV

XX

being encryption   XF FV GD GF XX GA FA XA GV GF GD GV XX

encryption if you look carefully in this case we see a pattern repeated “XX”, “GD” and “VG”. Central Bureau of figures belonging to France had a cryptanalyst named George Painvin which gotten down to decrypt it by early June 1918 achievement decipher a message which said the following “send ammunition quickly. Even during the day if not see them “in the same message is wise he had sent from a city located about 80 km from Paris, thanks to Painvin to halt the advance on Paris. -

Now this is very functional code to transmit it by telegraph as it only uses a very limited alphabet code only using the following symbols:

“A. -; D – .., F .. -.; G -., V … -, X – .. -”

 

Already in 1923 a German engineer named “Arthur Scherbius“, presented one of the most popular machines in the history of cryptography, which is called Enigma is a system being improved Alberti disk

 

 disco de Alberti

Enigma machine

Cryptographic This system became a priority for countries that were facing the Germans, whereas the intelligence services in Poland and the United Kingdom being the Polish mathematician, Marian Rejewski, conducted one of the most important tasks in the history of cryptanalysis combining mathematical and statistical calculations noticed a pattern in the code that was repeated twice at the beginning of the message, this one to suppose that the wiring of a rotor of the letters, but by the way these changed. -

Then leave a flash enigmaco.de showing the operation of the key Enigma

Alan Turing at Bletchley Park work (now current museum of cryptography), convened by the British government along with others with the aim of breaking the Enigma code for this task built a machine called Colossus and was one of those responsible for rupture of the key enigma II

 

Other Cryptographic Algorithms

The Navajo code

The Navajo code was an American cipher used in the Second World War in the Pacific theater. This system used the Navajo language, which was practically impossible to learn without being of the Navajo culture, this code was used on the front lines and those responsible for encrypting and decrypting them were Navajo. while this code is fairly rudimentary never was deciphered during use. -

Part of the Navajo Code Used in the Second World War

Letra Navajo Significado Traducción
A Wol-la-chee Ant Hormiga
B Shush Bear Oso
C Moasi Cat Gato
D Be Deer Ante
E Dzeh Elk Impulso
F Mi-e Fox Zorro
G Klizzie Goat Cabra
H Lino Horse Caballo
I Tkin Ice Hielo
J Tkele-cho-gi Jackass Baudet
K Klizzie-yazzie Kid Cabrito
L Dibeh-yazzie Lamb Cordero
M Na-as-tso-si Mouse Ratón
N Nesh-chee Nut Avellana
O Ne-ahs-jah Owl Buho
P CBiSodih Pig Cerdo
Q Ca-yeilth Quiver Aljaba
R Gah Rabbit Conejo
S Dibeh Sheep Oveja
T Than-zie Turkey Pavo
U No-da-ih Ute Piel-rojo
V A-keh-di-glini Victor Vencedor
W Gloe-ih Weasel Comadreja
X Al-an-as-dzoh Cross Cruz
Allí Tsah-as-zih Yuca Yuca
Z Besh-do-gliz Cinc Cinc

In future post we will see some of the most popular methods of cryptography. -

Cristian Amicelli Rivero

Cryptography – Part One

Old Cryptography

The next series of blogs on cryptography are aimed at those who do not have extensive knowledge of cryptography and are interested in the subject. -

To begin we must define what is cryptography that according to the Royal Spanish Academy is the art of writing with a secret key or enigmatically. The word cryptography comes from the Greek krypto (hidden), and graphos (write), which literally be hidden writing, with this definition we can say it is art rather than old. -

We can say that cryptography was used by the Babylonians around 2,500 BC in a kind of tablet on which are terms to which they took their first consonant or likewise use a few common characteristics in order to hide formulas for creating clay, or the case of Hebrew scholars who took monoalphabetic substitution ciphers (encryption Atbash) dating from 600 BC or so.

But the first encryption system described was used by the Spartans during the Peloponnesian War, where the Athenians fought between the year 431 BC and 404 BC the method described by Plutarch is the first transposition cipher system known scitala Spartan in this method took two pieces of wood are exactly alike in their thickness (which we call key) To write a secret message is rolled fabric on the rod and the message was written on top of that fabric. When unrolled, the text was not legible, thus leaving the encrypted message. -

“Transposition method encrypts the plain text by changing the order of the letters.”

This was followed in 150 BC an encryption called Polybius (203-120 BC) the famous Greek historian, this system consists of a table as shown below. -

as shown the letters i, j are together to give a total of 25 positions, with this system a method of substitution. -

do a test, suppose we want to encrypt the word mkit

plaintext: mkit

take the “M” and look for his cell and see that the row numbers and column form, 32 thus to “M” found 32. -

ENCRYPTION: 32252444

decoding must be separated into groups of 2 digits and place the letters knowing that the first number are the rows and second columns. -

Although the cryptographic method known and most studied of antiquity is the Code Cesar, which was created in about AD 50 and widely used by the Roman Emperor Gaius Julius Caesar (100-44 BC). This encryption method is displacement, its operation is very simple and allows the study of modular arithmetic. -

Its operation is very simple since it is the movement and the key is to move as the alphabet, we see an example

Original alphabet: ABCDEFGHIJKLMNÑOPQRSTUVWXYZ
Coded alphabet:    XYZABCDEFGHIJKLMNÑOPQRSTUVW

In this case the displacement is 24 spaces to the right and this action can change the encryption key. -

Once you have established your key to encrypt, so let’s use the word again mkit. -

plaintext: mkit

to encrypt the task is to find each letter in the original script and play the corresponding alphabet in the encoding and decoding is the reverse. -

Clear text  mkit
Cipher Text JHFQ

The vulnerability in this method is given for a frequency analysis, because without knowing the amount of displacement of the alphabet but if having a table of frequency of use of the letters (see picture), one can deduce the content of the message. -

“The frequency analysis is the study of the frequency of letters or groups of letters in a ciphertext. this being a method for breaking classical ciphers “

 

 Cristian Amicelli Rivero


Cafe-Latte Attack – Segunda Parte

Cafe Latte Attack

Como lo prometido es deuda, vamos a ver en este articulo un poco más en detalle de que se trata el Cafe-Latte Attack visto desde un punto de vista mas Técnico.
Para comprender y contextualizar el ataque deberían leer el artículo anterior “Wi-Fi Roaming Hacking”.

El ataque consiste en varios pasos que iremos disectando a lo largo del artículo, y vamos a comenzar viendo cómo funciona una conexión Wirless con encriptación WEP.

La secuencia para lograr la transferencia de datos con el Access Point es la siguiente:

-El cliente envía un “Probe Request”: Es una petición para obtener información mas detallada de otra “Estación”.

-El AP devuelve un “Probe Response”: Este Frame contiene información sobre las capacidades propias de la estación, como por ejemplo información que soporta.

-El cliente envía un “Autentication Request”: Dentro de este frame simplemente se envía una petición de identificación por parte de ambas partes, el cliente envía la petición. (En el caso de OPN authentication) (Si la autenticación fuese “Shared key” se enviara un Challenge).

-El AP envía un “Authentication Response”: En este frame se Acepta la identidad del cliente.

-El cliente envía un “Association Request”: Carga información sobre el SSID o nombre de la RED mas información propia de las capacidades del cliente.

-El AP envía un “Association Response“: Contiene la aceptación o la negación del cliente más información extra sobre el tipo de comunicación, etc.

-El cliente envía un paquete ARP Gratuitous.

Para verlo de forma grafica acá hay un dibujo:

Conexion Wireless

 

Una vez entendido el funcionamiento básico, voy a proceder a hablar un poco sobre la estructura de los paquetes, para poder comprender el funcionamiento interno del ataque del Cafe-Latte.

Partiendo desde la información que se debe enviar a través de la red, el proceso mediante el cual tiene que pasar, es el siguiente:

1) El texto plano es procesado por un Algoritmo llamado CRC dando origen a un ICV (Integrity Check Vector 0 Vector de chequeo de integridad).

2) El texto plano es Concatenado con el ICV.

3) La CLAVE concatenada con un IV (Vector de inicialización (El talón de Aquiles de WEP)) son ingresados en un algoritmo llamado RC4.

4) Se hace un XOR de las operaciones del punto 2) y 3) para dar lugar al Texto Encriptado. Luego, se concatena con el mismo IV de dichas operaciones, lo que da lugar al Paquete que va a viajar a través de la red.

Flujo WEP

Lo que se descubrió, hace ya varios años, es que teniendo un paquete valido se podría llegar a crear un nuevo paquete igual de valido gracias al proceso de creación del mismo. (No vamos a entrar en detalles)

Básicamente, se toma un texto plano cualquiera, se crea un parche de ICV y luego se aplica una operación XOR entre el paquete valido, y la data a inyectar. Este resultado pasa nuevamente por una operación XOR con el RC4 Keystream, proceso mediante el cual se obtiene un paquete encriptado con información irrelevante, pero que es aceptado por el AP! Esto significa, que podríamos lograr aumentar el flujo de información, para así lograr capturar mas data para crackear la WEP key.

O mejor aún, y como en el caso de nuestro ataque, podríamos fingir ser el AP, esperar la conexión del usuario y generar tráfico VÁLIDO entre el atacante y la víctima sin necesidad de desencriptar ni interpretar la información intercambiada, ya que el objetivo principal es obtener la clave WEP para lo cual necesitamos generar la mayor cantidad de paquetes posibles para poder crackearla.

Como vimos anteriormente, si un equipo tiene configurado por defecto la conexión automática a ciertas redes, este envía “Probe Requests” continuamente con el SSID de la red que está buscando. Esto sucederá con todas y cada una de las redes a las que se haya conectado anteriormente y haya configurado como “Favoritas” o con “Conexión automática“.

Airodump

Como podemos apreciar en la imagen, la captura del airodump nos muestra un equipo que no está asociado a ningún Bssid, que está enviando “Probe Requests” hacia diversas redes. Si miramos más detalladamente, también podemos observar que ninguna de esas redes se encuentra dentro de las redes disponibles. Esto nos da una idea sobre que conexiones por defecto aceptaría el cliente.

Procedemos a hacer un AP rogue para engañar al cliente y que se conecte de forma automática. Dentro de airbase podemos seleccionar además, algunas opciones extras, entre las cuales se encuentra el ataque de Cafe-Latte que consiste en aplicar la técnica del XOR para inyectar paquetes y genera trafico extra.

Airbase

Como vemos, la MAC adress del AP fue seteada en AA:AA:AA:AA:AA:AA y nuestra AP ya está enviando beacon frames para atrapar a nuestra víctima. El ESSID fue seteado como “Optimus” que es una de las redes configuradas por defecto en el cliente.

El airodump, nos muestra si el cliente ha iniciado el proceso de iniciación y como vemos abajo, el proceso fue iniciado exitosamente !

Cliente Asociado

Y para entender lo explicado anteriormente, un screenshot de Wireshark que nos da un entendimiento más profundo a nivel Red:

Wireshark - Probe Request/Response - Authentication Reques/Response - Association Request/Response

También al mismo tiempo, vemos como el Airbase detecta y nos advierte sobre un usuario conectándose a nuestro Fake AP. Una vez conectada la víctima, Aribase lanza automáticamente el Cafe-Latte Attack!!!!!!!

Attack Lunched

Una vez obtenida la Data suficiente como para crackear la clave (Si todo sale bien, puede ser en cuestión de 4 minutos):

Crackeo de clave

Si leyeron el artículo anterior de Cristian Amicelli Rivero, ARPSPOOF , podrán idearse muchos ataques nuevos una vez conseguida la autenticación dentro de una red Local. Desde la redacción de Mkit, vamos a seguir mostrando paso a paso, los diversos tipos de ataque que pueden llevarse a cabo utilizando como punto de partida, las técnicas presentadas en estos últimos artículos, así que recomiendo prestar detallada atención y de ser necesario, ampliar un poco más la información presentada.

En conclusión: Habiendo visto la facilidad con la que alguien puede hacerse de nuestra clave Wi-Fi inclusive estando a kms de distancia del Access point y sabiendo que ni siquiera las claves WPA/WPA2 son infalibles, la mejor opción es desactivar la configuración de conexión automática / redes favoritas. Nunca sabemos quién puede estar tras nuestra información, y querer conseguir acceso a nuestra red casera. Dar esa ventaja seria como aceptar un caballo de Troya pero sin siquiera saber de su existencia. Apretar un botón cada vez que iniciamos la sesión, no es mucho esfuerzo en comparación con el riesgo que corremos dejando que nuestro S.O se encargue de hacerlo por nosotros.

Gustavo Nicolas Ogawa