Hashing and Regrex Flashcards

1
Q

What is hashing

A

Hashing is a cryptographic process that can be used to validate the authenticity and integrity of various types of input.

Hashing is a way of transforming your a file into a unique identifier that are hard to invert and essentially reverse.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Hashing algroithm

A

A hashing algorithm is a cryptographic hash function. It is a mathematical algorithm that maps data of arbitrary size to a hash of a fixed size.

It is designed to be a one way function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Types of hashing algo

A

MD5, SHA, CRC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe MD

A

(MD stands for Message Digest): An MD5 hash function encodes a string of information and encodes it into a 128-bit fingerprint. It is one of the most commonly used yet amongst the most unsecure algorithms. Suffers extensive hash collision vunlerabilites

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe SHA

A

Secure Hash Algorithm (SHA-0, SHA-1, SHA-2 family of algorithms) SHA-2 developed by the National Security Agency (NSA). The SHA-2 family consists of six hash functions with digests (hash values) that are 224, 256, 384 or 512 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe CRC

A

CRC (cyclic redundancy code):A cyclic redundancy check (CRC) is an error-detecting code often used for detection of accidental changes to data

Encoding the same data string using CRC32 will always result in the same hash output, thus CRC32 is sometimes used as a hash algorithm for file integrity checks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give an example of using the hash password techniques

A

MessageDigest msgDigest = MessageDigest.getInstance(“SHA-256”);
msgDigest.update((new String(msg)). getByte(“UT8”));
String hash = new String(msgDigest.digest());

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe salt

A

Another best practice for secure password storage is to combine each password with a randomly generated string of characters called a “salt” and then to hash the result

Salting also prevents attackers from discovering duplicate passwords in a database. 16 characters long

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe Pepper

A

To add another layer of security, in addition to salts, developers can also combine all passwords with a randomly generated string of at least 32 characters called a pepper.

Unlike a salt, which is unique for every password, the pepper is the same for all passwords but should not be stored inside the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly