Skip to content

CRIPTOGRAPHY is terrifying it's based on maths that most of us don't understad,Yet it's the one thing that makes internet secure.Without the mysterious work of Criptography there will be NO-Secrete or NO-Privacy in the digital world,Our E-mails,Browsing history easily hackabel.

License

Notifications You must be signed in to change notification settings

Ranjika123/Cryptography-For-Babies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CRIPTOGRAPHY💵 Concepts Developer shoud Know

What is CRIPTOGRAPHY ?

CRIPTOGRAPHY is terrifying it's based on maths that most of us don't understad,Yet it's the one thing that makes internet secure.Without the mysterious work of Criptography there will be NO-Secrete or NO-Privacy in the digital world,Our E-mails,Browsing history easily hackabel.

Our computers are designed to do what we tell to do,but sometimes we don't want to do certains things like publishing private data

It collect useful data and upload throught the viered algorythem to mix it up,so computer can't read it without proper values

History of CRYPTOGRAPHY 🐵

Cryptography has a long and fascinating history that spans thousands of years. Some of the earliest examples of cryptography are found in ancient civilizations, such as Egypt, Greece, Rome, China, and India. They used simple techniques, such as substitution and transposition, to hide messages from their enemies or allies. For example, the Caesar cipher, named after Julius Caesar, is a simple substitution cipher that shifts each letter of the alphabet by a fixed number of positions. The Vigenère cipher, developed in the 16th century, is a more complex substitution cipher that uses a keyword to determine the shift for each letter. The Enigma machine, used by the Nazis during World War II, is a famous example of a mechanical device that implements a complex substitution cipher with multiple rotors and plugboards.

As technology and mathematics advanced, cryptography also evolved to become more sophisticated and secure. Modern cryptography is based on concepts such as number theory, algebra, and probability. It uses complex algorithms and protocols to achieve various goals, such as encryption, decryption, authentication, digital signatures, key exchange, and more. Modern cryptography also relies on the concept of computational hardness, which means that some problems are so difficult to solve that even the most powerful computers would take a very long time to crack them. For example, the RSA algorithm, one of the most widely used public-key encryption schemes, is based on the difficulty of factoring large numbers.

HASH

A hash function is a mathematical function that takes any input data and produces a fixed-length output, called a hash or a digest. A hash function has two main properties: it is easy to compute the hash from the input, but it is hard to find the input from the hash. A hash function is also designed to be collision-resistant, which means that it is very unlikely that two different inputs will produce the same hash. A hash function can be used for various purposes, such as:

  • Verifying the integrity of data: A hash function can be used to check if the data has been tampered with or corrupted. For example, when you download a file from the internet, you can compare the hash of the file with the hash provided by the source to make sure that the file is authentic and not modified by a malicious party.

  • Authenticating messages: A hash function can be used to prove that a message was sent by a certain party and not altered by anyone else. For example, a sender can append a hash of the message to the message itself, and the receiver can verify the hash using the same hash function. This is called a message authentication code (MAC).

  • Indexing data: A hash function can be used to map data to a smaller space, such as a table or an array. For example, a hash table is a data structure that uses a hash function to store and retrieve data efficiently.

Some examples of hash functions are MD5, SHA-1, SHA-2, and SHA-3.

SALT

A salt is a random value that is added to the input of a hash function to make the hash more unpredictable and resistant to attacks. A salt is usually stored along with the hash, so that the hash can be verified later. A salt can be used for various purposes, such as:

  • Preventing rainbow table attacks: A rainbow table is a precomputed table that contains the hashes of common passwords or phrases. An attacker can use a rainbow table to find the input of a hash by looking up the hash in the table. A salt can prevent this attack by making the hash unique for each input, so that the attacker would have to compute a new table for each salt.

  • Preventing dictionary attacks: A dictionary attack is a brute-force attack that tries to guess the input of a hash by using a list of common or likely passwords or phrases. A salt can prevent this attack by making the hash different for each input, so that the attacker would have to try each password or phrase with each salt.

  • Increasing the entropy of passwords: A salt can increase the entropy, or randomness, of passwords by adding more bits to the input of the hash function. This makes the passwords harder to crack by increasing the search space for the attacker.

HMAC

HMAC stands for Hash-based Message Authentication Code. It is a type of MAC that uses a hash function and a secret key to authenticate messages. HMAC has the following format:

HMAC(K, M) = H((K ⊕ opad) || H((K ⊕ ipad) || M))

where:

  • H is a hash function, such as SHA-256

  • K is a secret key, shared by the sender and the receiver

  • M is the message to be authenticated

  • ⊕ is the bitwise XOR operation

  • || is the concatenation operation

  • opad and ipad are constant values, defined by the hash function

HMAC can be used for various purposes, such as:

  • Providing message integrity: HMAC can be used to ensure that the message has not been modified or corrupted by anyone else. The sender can compute the HMAC of the message and append it to the message itself, and the receiver can verify the HMAC using the same hash function and key. If the HMACs match, the message is authentic and intact.

  • Providing message authentication: HMAC can also be used to prove that the message was sent by a certain party and not forged by anyone else. The sender and the receiver must share a secret key, which is used to compute and verify the HMAC. If the HMACs match, the message is authentic and from the expected party.

Symmetric encryption

Symmetric encryption is a type of encryption that uses the same key to encrypt and decrypt data. Symmetric encryption has the following format:

C = E(K, P) P = D(K, C)

where:

  • C is the ciphertext, or the encrypted data

  • P is the plaintext, or the original data

  • K is the secret key, shared by the sender and the receiver

  • E is the encryption function

  • D is the decryption function

Symmetric encryption can be used for various purposes, such as:

  • Providing confidentiality: Symmetric encryption can be used to protect the data from unauthorized access or disclosure. The sender can encrypt the data using the secret key and send the ciphertext to the receiver, and the receiver can decrypt the ciphertext using the same key. Only the parties who know the key can access the data.

  • Providing efficiency: Symmetric encryption is usually faster and simpler than other types of encryption, such as asymmetric encryption. Symmetric encryption can be implemented using various algorithms, such as AES, DES, and RC4.

Keypairs

A keypair is a pair of keys that are mathematically related to each other. A keypair consists of a public key and a private key. A public key is a key that can be shared with anyone, and a private key is a key that must be kept secret by the owner. A keypair can be used for various purposes, such as:

  • Providing asymmetric encryption: Asymmetric encryption is a type of encryption that uses different keys to encrypt and decrypt data. Asymmetric encryption has the following format:

C = E(Pu, P) P = D(Pr, C)

  • C is the ciphertext, or the encrypted data

  • P is the plaintext, or the original data

  • Pu is the public key of the receiver

  • Pr is the private key of the receiver

  • E is the encryption function

  • D is the decryption function

Asymmetric encryption

Asymmetric encryption can be used to provide confidentiality and key exchange. The sender can encrypt the data using the public key of the receiver and send the ciphertext to the receiver, and the receiver can decrypt the ciphertext using their private key. Only the receiver can access the data, since they are the only one who knows their private key. The sender and the receiver can also use asymmetric encryption to exchange a secret key, which can be used for symmetric encryption or other purposes.

Providing digital signatures: A digital signature is a way of verifying the authenticity and integrity of a message or a document. A digital signature has the following format:

S = D(Pr, M) V = E(Pu, S)

where:

  • S is the signature, or the encrypted message or document

  • M is the message or document to be signed

  • Pr is the private key of the sender

  • Pu is the public key of the sender

  • D is the decryption function

  • E is the encryption function

  • V is the verification result, which is either true or false

A digital signature can be used to provide authentication and non-repudiation. The sender can sign the message or document using their private key and append the signature to the message or document itself, and the receiver can verify the signature using the public key of the sender. If the verification result is true, the message or document is authentic and from the expected party, and the sender cannot deny sending it. If the verification result is false, the message or document is forged or modified by someone else.

Some examples of keypair algorithms are RSA, DSA, and ECC.

END

Ranjika Nethpriya

License

This project is licensed under the MIT License.

Give It a Star ✌

About

CRIPTOGRAPHY is terrifying it's based on maths that most of us don't understad,Yet it's the one thing that makes internet secure.Without the mysterious work of Criptography there will be NO-Secrete or NO-Privacy in the digital world,Our E-mails,Browsing history easily hackabel.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published