Posts

Showing posts with the label Computer Security

Basic of Cryptography (Type of Cryptography)- Part II

Image
Cryptography Types Cryptography categorized based on number of keys used for encryption and decryption; in this article we will discuss below three types Secret Key Cryptography - It is also call symmetric encryption where for both encryption and decryption uses same key. This is mainly used for confidentiality. Public Key Cryptography - It is also called asymmetric encryption ; this algorithm uses two key's one for encryption and one for decryption. mainly used for authentication. Hash Function - It uses to convert to text in such way that the input cannot be recoverable by using mathematical function.

SHA-256(Source Code in C# using .Net in-built Cryptography library) - Part II

.Net Framework provides in built support for various hash functions like MD-5, SHA-1, SHA-256 etc... ComputeHash method Computes the hash value to the specified byte array. Below are the overloaded methods to Compute Hash using SHA-256 class in System.Security.Cryptography  library public byte [] ComputeHash( byte [] buffer) public byte [] ComputeHash( Stream inputStream) public byte [] ComputeHash( byte [] buffer, int offset, int count)

SHA-256(Source Code in C#) - Part I

SHA-256 (Secure Hash Algorithm) , is one of the cryptographic hash function, commonly used in Blockchain. It generates an almost-unique 256-bit (32-byte) signature for a text.  SHA-256 is successor hash functions to SHA-1. it is one of the strongest hash functions available and has not yet been compromised in any way.   Here is source code written in  C#. I will try to give more details in next Part II

What do you mean by Hashing?

Hashing is process of converting any size of data into fix size of data by performing mathematical operations. A message to be hashed is called input; the Algorithm is used to do so is called hash function; the output is called hash value. There are many algorithm which used to generate hash value like MD5, SHA-1, SHA-256, Tiger etc.  Hash function generates a unique value, this means two input always generates different hash value.    Hash value can not be decrypt once it's hashed, this is the difference between encryption and hash. Encrypted value can be decrypt using keys but we can not extract input from Hash value. Common use of Hash is to store password into database. 

Basic of Cryptography - Part I

Cryptograph means secret writing, in order to make information secret we use cipher, an algorithm that converts plain text to cipher-text. Cipher has been used long before computer existance. In 44 BC  Julius Caesar uses the technique now called Caeser Cipher  to send message. He used to shfit the letter by 3 character.  Another great example from history, Nazis Enigma Machine used during war to translate message. Data Encryption Standard (DES) is the first algorithm written for Cryptography in early 19th century. A process of making text secret is called Encryption and the reverse process is called Decryption. So far the Cryptography technique we mentioned  above relies on keys known by sender and receiver. Though manual sharing key is not good idea, solutions is to automate exchange of keys. We can do this by using one way functions , to understand one way function here is the Good example of one way function is Diffie-Hellman key exchange .  There are two types