7 Mayıs 2018 Pazartesi

RSA (Rivest–Shamir–Adleman) Kriptosu

Giriş
RSA symmetric değildir. Eğer authentication yoksa Man-In-The-Middle saldırılarına karşı biraz daha açık olabilir.

RSA için genellikle 2048 bit uzunluğunda anahtar tercih edilir. Bu anahtar ile 112 bit simetrik şifreleme güvenliği elde edilir.

Algoritma
Kitaptaki RSA algoritması şöyle.
c(m) = (m)^p mod n 
c(m)=(1)^77 mod 21 =1
Açıklaması şöyle.
Cryptography over quasi-fields (which are not field, but where non-invertible elements are
hard to find) is very common. 
RSA Signature
RSA şifreleme ve RSA Signature farklı şeylerdir. Açıklaması şöyle.
A RSA public key consists in a big number n (the "modulus") and a (usually small) number e (the public exponent). e can be as small as 3, and in a closed setup (where you control key generation) you can force the use of a conventional e, the same for everybody. A typical size for n is 1024 bits (i.e. 128 bytes).

n is the product of two prime numbers (n = p*q). Knowledge of p and q is sufficient to rebuild the private key (nominally a value d which is a multiplicative inverse of e modulo p-1 and q-1). Assuming that n is known, knowledge of p alone is sufficient (if you know n and p, you can compute q with a simple division). For proper security, p and q should have similar sizes, so even by taking the smaller of the two, you still need to store about 512 bits or so -- that's 64 bytes).

It has also been suggested to select a small d (the "private exponent"). But this makes e essentially random, hence large; you can no longer use a conventional small value for e. This basically doubles the public key size. Also, forcing a small d can make the key weak (it has been shown to be the case when the size of d is no more than 29% of the size of n, but that does not prove in any way that a d of 30% the size of n is safe). This is generally considered to be a bad idea.
Malware
RSA malware yazılımlarda şöyle kullanılıyor.
In traditional malware using RSA approach, the public key may be hard-coded in the malware binary and is used to encrypt a symmetric key generated on the system. The symmetric key itself is used to encrypt user files.

RSA-OAEP
Açıklaması şöyle.
Textbook RSA and is not used in practice for numerous security reasons.

In practice, you have to pad( or armor) your message. This should be done using the RSA-OAEP (also called PKCS#1 v2.0) scheme. It transforms your message
into a random block which is then processed by the RSA encryption.
C#
Kripto yazısına taşıdım.

Hiç yorum yok:

Yorum Gönder