Inmortalidad
February 25th, 2006
“Either the soul is inmortal and we shall not die, or it perishes with the flesh, and we shall not know then that we are dead. Live, then, as if you were eternal.”
- André Maurois
Seguridad
February 25th, 2006
“Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one.”
- Thomas Jefferson, Tercer Presidente de los Estados Unidos
Poder
February 25th, 2006
“Nearly all men can stand adversity, but if you want to test a man’s character, give him power.”
- Abraham Lincoln, Dieciseisavo Presidente de los Estados Unidos
Crédito
February 25th, 2006
“My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there.”
- Indira Gandhi
Derechos y deberes
February 25th, 2006
“Todo derecho que no lleva consigo un deber, no merece que se luche para defenderlo.”
- M. Ghandi
Libertad
February 25th, 2006
“La libertad, querido Sancho, es uno de los mas preciosos dones que a los hombres dieron los cielos.”
- Don Quijote de La Mancha
UNIX
February 25th, 2006
“Contrary to popular belief, Unix is very user friendly. It just happens to be very selective about who it’s friends are.”
- Kyle Hearn
Block sender address spoofing with SMPT AUTH
February 19th, 2006
In order to evade mail-relaying, unathorized users try to spoof the e-mail sender address in mail messages. One trick they use consists in making Postfix think the sender belongs to a mail domain in $mydestination (that the message comes from a domain belonging to the list of domains that Postfix considers itself the final destination for).
For example:
mydomain = example.com
myorigin = $mydomain
mydestination =
$mydomain,
mail.$mydomain,
www.$mydomain,
ftp.$mydomain,
localhost
The unauthorized user could try to pose as user@example.com in order to send messages to other users in the example.com mail domain, or to other users in other mail domains.
One way to stop this from happening is by using Authenticated SMTP (so Postfix can track who the sender is) and by establishing a relationship between (authenticated) users and message addresses. For example, we can link user user1 to message addresses user1@example.com and user2@example.com. So, when user1 authenticates against Postfix, he is allowed to send messages as either user1@example.com or user2@example.com, but no other address from the example.com mail domain.
This can be achieved by listing the option reject_sender_login_mismatch inside smtpd_recipient_restrictions. For example:
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_invalid_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unknown_address,
reject_non_fqdn_hostname,
reject_unauth_destination,
reject_sender_login_mismatch
reject_sender_login_mismatch works in cooperation with smtpd_sender_login_maps, which defines the linking between (authenticated) users and mail addresses. This mapping is defined using a table, which can be stored in a plain-text file and then converted to a hash table, a mysql table, etc. For example:
smtpd_sender_login_maps =
hash:/etc/postfix/smtpd_sender_login_maps
The table is stored as a hash map, whose plain-text representation is stored in file /etc/postfix/smtpd_sender_login_maps. This plain-text file is then converted to a hash map by using the postmap command:
# cd /etc/postfix # postmap smtpd_sender_login_maps
Thus, smtpd_sender_login_maps specifies ownership of MAIL FROM addresses, as used by the reject_sender_login_mismatch sender address restriction.
Each line of the table specifies a sender address and the (authenticated) user login name that owns that address. The table has the following syntax and search order:
user@domain ownerThis form has the highest precedence. A user who successfully authenticates against Postfix as
ownercan send messages asuser@domain.user ownerThis matches
user@sitewhensiteis equal to$myorigin, whensiteis listed in$mydestination, or whensiteis listed in$inet_interfaces.@domain ownerThis matches every address in the specified domain, and has the lowest precedence.
For example, a file /etc/postfix/smtpd_sender_login_maps with these entries:
user1@example.com user1 user2@example.com user1 user3@example.com user3 @example.com user4
Has the following meaning:
user1owns bothuser1@example.comanduser2@example.commail addresses.user3ownsuser3@example.comuser4owns any other address from the@example.commail domain, exceptuser1@example.com,user2@example.comanduser3@example.com.
Thus, user1 can send messages as user1@example.com or user2@example.com, but he is not allowed to pose as sender user3@example.com or any other address.
NOTE: More information about Postfix UCE (Unsolicited Commercial E-mails) can be found here.
Cómo romper RFID con un teléfono móvil
February 16th, 2006
Parece ser que las presiones por parte de algunos sectores económicos para que se fabriquen chips de Identificación por Radiofrecuencia a un precio menor, están haciendo que esta polémica tecnoloǵia sea, además, algo insegura al tener que eliminar características que teóricamente los harían más seguros.
Firma digital
February 14th, 2006
Una de las creencias más extendidas, y que más me asusta, es aquella que hace parecer a la firma digital un sustituto infalible de la firma escrita.
Fundamentalmente, la firma digital se apoya en dos conceptos criptográficos:
- Funciones criptográficas de clave pública
Las más representativas son RSA (las siglas de Rivest, Shamir y Adleman) y DSA (las siglas de Digital Signature Algorithm, a veces también llamado DSS, Digital Signature Standard), o ElGammal.
- Funciones criptográficas de resumen
Las más representativas son MD5, SHA-1, la familia SHA-2 (SHA-256, SHA-384 y SHA-512) o RIPE-MD160.
Brevemente, para firmar digitalmente un documento, llamémoslo M, se calcula, mediante una función criptográfica de resumen, un resumen de éste, sea H:
[1] H = f(M)
A este resumen H también se le conoce como huella digital.
Posteriormente, se cifra esta huella digital H utilizando la clave privada del firmante. El resultado es lo que se conoce como firma digital.
El problema de la firma digital es que no se firma el documento original, sino un derivado de éste (en este caso, un resumen obtenido de él a partir de una función criptográfica de resumen). Tal y como se mostrará a continuación, existe un gran número de mensajes, distintos del mensaje original M, a los cuales, si se les aplica la función de resumen f(x), se obtiene el mismo resumen o huella digital H.
Por consiguiente, cuando se firma digitalmente un documento, en realidad, la firma digital resultante corresponde al documento original y a un número muy alto (teóricamente infinito) de documentos diferentes del original.
¿Qué ocurre si un individuo pudiera generar un documento M', distinto en contenido de M, pero semánticamente similar, tal que al resumir este M' se obtuviera la misma huella digital H que corresponde al documento original M? (véase [2]) ¿Qué ocurriría si este documento M fuese un documento PDF que contiene un contrato mercantil, y fuera posible hallar otro documento M', también en formato PDF, con un contrato mercantil similar al anterior pero distinto en importe o condiciones, pero que resume al mismo valor que M? Evidentemente, la validez de la firma digital quedaría en entredicho, siendo difícil argumentar a cual de los dos documentos representa. La respuesta correcta sería argumentar que la firma digital representa a ambos documentos.
Se ha visto que f(x) es una función de resumen criptográfica, como MD5. Esta función cumple una serie de propiedades, pero la más destacable es que genera un número infinito de colisiones: La cardinalidad del conjunto {M}, es decir, la cardinalidad del conjunto formado por todos los posibles mensajes M, tiende a infinito. Por el contrario, la cardinalidad del conjunto {H} formado por todos los posibles resúmenes o huellas digitales correspondientes a cada uno de los elementos del conjunto {M} es un número finito. Para la función MD5, equivale a 2128, para SHA-1 equivale a 2160, y para los miembros de la familia SHA-2, sean éstos SHA-256, SHA-384 y SHA-512, equivale a 2256, 2384 y 2512 respectivamente. Esto es consecuencia de [1].
Cuando se resume un mensaje M a través de una de estas funciones, se puede demostrar que existe, al menos otro mensaje M', distinto de M, que cumple:
[2] H = f(M) = f(M'), para M <> M'
Es más, para funciones criptográficas de resumen como las mencionadas anteriormente, lejos de la función ideal, se demuestra que existe un gran número (teóricamente infinito) de mensajes distintos de M que resumen al mismo valor que M (colisiones). De todos estos mensajes nos quedaremos con un M', de tal forma que sea éste un mensaje coherente con M (es decir, semánticamente similar o relacionado). Por ejemplo, si M es un documento en formato PDF, M' es también un documento en formato PDF, con un contenido muy similar, y que cumple la propiedad [2] anterior.
Para firmar digitalmente el documento M:
, donde
H = f(M)
FD = E(e, H)e es la clave privada utilizada para firmar
En el supuesto anterior, FD es la firma digital, H es la huella digital y M es el documento que se pretende firmar. Además, M' es tal que f(M') = f(M), lo cual es perfectamente posible, por lo que tenemos:
H' = f(M')
FD' = E(e, H')
pero como H' = H, entonces FD' = E(e, H') = E(e, H) = FD.
Como puede observarse, la firma digital FD representa no al documento original M, sino a sendos documentos M y M' simultáneamente. Ante un juez, ¿cuál de los dos es el que está firmado? Muy sencillo: ambos. Si ambos documentos entraran en contradicción, sería alto probable que la firma digital no tuviera validez legal alguna.
Ahora bien, ¿es ésto lo que quieren imponernos con el DNI digital? Espero que no.