Sokets
Communication between different entities on a network is based on the classic concept Python sockets. Sockets are an abstract concept that refers to the end point of a connection.The programs use sockets to communicate with other programs, which may be located on different computers.
A socket is defined by the IP address of the machine, the port on which it listens, and the protocol used.
The types and functions needed to work with Python sockets are in the socket module, how could it be otherwise.
Sockets are classified stream sockets (socket.SOCK_STREAM) or datagram sockets (socket.SOCK_DGRAM) depending on whether the service uses TCP, which is connection-oriented, reliable, or UDP, respectively. In this lesson we will cover only stream sockets, which cover 90% of the common needs.
RSA Key Generation
Divide the algorithm into 3 sections: this, key generation, encryption / decryption and signing / verification.
This part aims to generate public and private keys, composed by n one of the two exponents of example (so that the two are canceled), then go to:
First generate two primes with the number of bits we want for encryption, random everything possible, call them p and q, these numbers help us calculate the n and φ:
p = genprime (numero_de_bits)
q = genprime (numero_de_bits)
We get your product, n, and phi (φ) of this using the formula we saw earlier, φ = (p - 1) * (q - 1):
n = p * q
phi = (p - 1) * (q - 1).
This part aims to generate public and private keys, composed by n one of the two exponents of example (so that the two are canceled), then go to:
First generate two primes with the number of bits we want for encryption, random everything possible, call them p and q, these numbers help us calculate the n and φ:
p = genprime (numero_de_bits)
q = genprime (numero_de_bits)
We get your product, n, and phi (φ) of this using the formula we saw earlier, φ = (p - 1) * (q - 1):
n = p * q
phi = (p - 1) * (q - 1).
Conclusions
The program is incomplete due to connection problems because it encrypts and decrypts.
http://blog.hackxcrack.es/2011/11/introduccion-la-criptografia-moderna_09.html
http://mundogeek.net/archivos/2008/04/12/sockets-en-python/
http://www.taringa.net/posts/linux/8419721/Sockets-en-python_.html
http://es.wikipedia.org/wiki/RSA