Posts

Background of Secure Hash Function (SHA) and SHA-512.

Image
1. Background Regarding SHA   These Days, the most widely used hash function is secure hash function (SHA). SHA was developed by National Institute of Standards and Technology (NIST). After that, when some weakness found in SHA then with some additional revision the new version of SHA is launched Which is called as SHA-1 and the previous version of SHA was called as SHA-0. SHA is basically based on MD4, and its design closely models MD4. Fig. 1 defines the Secure Hash code that is somehow important for SHA.  Fig. General structure of Secure Hash Code SHA-1 produces a hash value of 160 bits. In 2002, NIST produced a revised version of standard, FIPS 180-2, that defines three new version of SHA, with hash value lengths of 256, 384, and 512, know as SHA-256, SHA-384, SHA-512. Collectively, this hash algorithm are comes under the category of SHA-2.  2. SHA-512 Logic  : This algorithm takes an input a message having maximum length less than 2^(128) bits and produces as ou...

Cryptographic Hash Function

Image
  1. Cryptographic Hash Function   :  A hash function H accepts a variable-length block of data M as input and produces a fixed-size hash value h = H(M). A good hash function have always input and outputs that are evenly distributed and apparently random. The hash function works on data integrity. so change in any bit say 'M' it will change to the hash code.  This kind of hash function are needed for security applications and referred to as a cryptographic hash function.  A cryptographic hash function is an algorithm which is computationally infeasible and having some properties :  A. The one way property. B. The collision free property.  Fig. 1. Cryptographic Hash Function; h = H(M) 2. Application of Cryptographic Hash Function  :    It is widely used in security applications and internet protocols.  2.1 Message Authentication  : It is a mechanism or service used to verify the integrity of a message. It means it assures that t...

Elliptic Curve Cryptography

Image
 Outline: 1. Elliptic Curve Arithmetic  2. Elliptic Curves over Real Numbers  3. Elliptic Curve on a Zp 4. Elliptic Curve Key Exchange  5. Security of Elliptic Curve Cryptography (ECC) 1.  Elliptic Curve Arithmetic  :  Firstly, Elliptic curve are not ellipse 😂. They are named so because they are described by cubic equation.  Now Let's go for the little bit background regarding the derivation :  Suppose there is a set of balls which shown in the form of a pyramid. Let x be the height of pyramid so total number of balls that can be stored in a pyramid is -  1^2+2^2+3^2+………..+x^2 = (x(x+1)(2x+1))/6 now fit these balls into square then  Y^2 = (x(x+1)(2x+1))/6 2. Elliptic Curve over Real Numbers  :  Elliptic curve are not ellipse. They are so named because they are described by cubic equations, similar to those used for calculating the circumference of an ellipse.  since we know that Y^2 = (x(x+1)(2x+1))/6 so accordi...

Elgamal Cryptographic System

  1.  Elgamal Cryptographic System  : In 1984, T. Elgamal announced a public Key scheme based on discrete logarithms closely related to Diffie Hellman technique. This uses in some form in a number of standards including the digital signature(DSS) and the S/MIME e-mail standard.  Global Public Elements q Prime number α α < q and α a primitive root of q.   Key Generation by Alice Select Private Key Xa Xa < q-1 Calculate Ya Ya = α ^(Xa) mod q Public Key {q, α , Ya} Private Key Xa   Encryption by Bob with Alice’s Public Key Plaintext M < q Select random integer K K < q Calculate K ...

Diffie-Hellman Key Exchange

Image
  1.  Diffie-Hellman Key Exchange  : It is a kind of method of securily exchanging the cryptographic key over a public channel. Figure 1 explains the functionality of proposed algorithm. Fig. 1: The Diffie-Hellman Key Exchange Note 1. In Diffie-Hellman algorithm the key exchange by both the person say Bob and Alice are same.  Since We know that K = (Yb)^(Xa) mod q                                { as we know Yb =  α^(Xb) mod q)}   = (( α^(Xb) mod q))^(Xa) mod q  =  α^(XaXb) mod q  = (α^(Xa) mod q)^(Xb) mod q  = (Ya^(Xb) mod q) Hence, above calculation shows that both keys are same.    1.1 Man-in-the-Middle Attack  Since if the value is small then it can be easily break with brute force approach.  The protocol depicts in diffie hellman algorithm is insecure against a man in middle attac...

Public Key Cryptography and RSA

Image
1. Public Key Cryptography  :  Public key cryptography is also known as Asymmetric cryptography which uses the concept of two keys i.e. Public key and Private key. Generation of such key pairs depends on the cryptographic algorithm which are based on Mathematical problem termed as one-way function.  2. Principles of Public Key Cryptography : key distribution under symmetric encryption requires either  A. That two communicants already share a key, which somehow has been distributed to them or B. The use of Key distribution center. 3. Public Key Cryptosystem  : Asymmetric algorithm relay on one key for encryption and a different but related key for decryption. These algorithm have the following important characteristic.  A. It is computationally infeasible to determine the decryption key given only knowledge of the cryptographic algorithm and the encryption key. B. In addition, some algorithm, such as RSA, also exhibit the following characteristic- B.1. Eithe...

Pseudorandom Number Generation and Stream Cipher

Image
1.    The Use of Random Number   1.1 Key Distribution : Two parties communicating by exchanging keys. In many cases nonces are used for handshaking to prevent replay attacks.  1.2 Session Key Generation : Sometime a short key is needed during short period of time such as bank transactions.  2. How to check Randomness There are two ways to check randomness 2.1 Uniform Distribution : The frequency of occurrences of one and zero should be approximately equal. 2.2 Independence : No one subsequence in the sequence can be inferred  from the other. 3. How to Evaluate Random Number : 3.1 The function should be full period generating function. That is, the function should generate all the numbers from 0 through m-1 before repeating.  3.2 The generated sequence should appear random. 3.3 The function should implement efficiently with 32 bit arithmetic.  4. True Random Number Generation (TRNG) : It takes an Input as source which is effectively random source o...