Java Cryptography

Cryptography Foundations

Cryptology is the broader field that encompasses both cryptography and cryptanalysis.

Cryptography is the practice of creating secure communication by encoding messages in a way that is difficult to understand by unauthorized parties.

Cryptanalysis is the study of methods for breaking encryption algorithms and protocols without knowing the key.

PlainText-Encryption-CipherText-Decryption-PlainText

The Goals of Cryptography
Confidentiality
Data Integrity
Data Origin Authentication
Entity Authentication
Non-Repudiation

Cryptographic Primitives
Primitives
Encryption
Hash Function
MAC - Message Authentication Code.
Digital Signature



Q. SALT, What Is a Salt?
A salt is:
- A random sequence of bytes
- Combined with the input (e.g., password) before hashing
- Used to prevent attacks like rainbow table lookups or precomputed hash collisions
Without a salt:
- Two users with the same password will have the same hash. With a salt:
- Even identical passwords produce different hashes, making brute-force and lookup attacks far harder.


Q. What Is a Private Key?
A private key is:
- A secret cryptographic key known only to the owner
- Paired with a public key in asymmetric algorithms like RSA or EC
- Used to decrypt data encrypted with the public key
- Used to sign data so others can verify it with the public key


Comments

Popular posts from this blog

Java 25 Features

Java Version Features

Java 8 Programs