Serious Cryptography Flashcards

1
Q

How many letters does cesar cypher shift?

A

3

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

How do vigenere cipher works?

A

The key is not fixed like cesar, is defines a key using a word of N letters. This word is used to rotate every letter individually: CRYPTO encrypts to FLFSNV using DUH key.

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

What are the steps needed to break vigenere cipher?

A

1- find the key length: find for repeated sequences of letters in the ciphertext.
2- determine the key using frecuence análisis: Most common letters of abecedary.

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

Does classic ciphers operates with bits or letters?

A

Letters

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

In symmetric ciphers, what is a permutation?

A

A function that transform an item (letter or set of bits ) such that item has a unique inverse.

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

In symmetric ciphers, what is a mode of operation?

A

An algorithm that uses a permutation to process messages of arbitrary size. Mitigates exposure of duplicate letters in the plaintext by “scrumbling” all. (Confussion and difussion)

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

What is a substitution cipher?

A

Replace letters with other letters

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

When a permutation is secure?

A

When it satisfy 3 criteria:

1- The permutation should be determined by the key. ( in caesar is fixed and is 3)
2- Different keys should result in different permutations.
3- The permutation should look random. Knowing that A encrypts to B should not give you any other information.

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

Why classical ciphers are insecure?

A

Because their are limited to operations that humans can perform with their head.

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

Which cipher guaranties perfect secrecy?

A

One Time Pad

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

What is the length of a one time pad cipher

A

as long as the message

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

What an attacker can learn from a ciphertext computed with a one time pad?

A

The length of the message

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

How many times can use a single key on one time pad?

A

Just once

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

Why can´t we encrypt 2 message with the same key on one time pad?

A

Because of the XOR property. C1-xor-C2=(P1-xor-K)xor(P2-xor-K)=P1-xor-P2-xor-K-xor-K=P1-xor-P2

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

Why One time pad is not used on real life?

A

Because to encrypt a 1 tera file you will need a 1 tera key. Is not applicable for long messages.

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

Why is one time pad secure?

A

Shannon proof that if the key K is chosen randomly and that key is as long as the message, an attacker, even if he can proof all the possible keys, will now know nothing about the message, because it will have tons of valid messages.

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

What is an attack model?

A

Assumptions about what an attacker can do to interact with a cipher. Does not have to reality exactly, is an approximation.

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

What is a security goal?

A

Descriptions of what is considered a successful attack.

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

What kerchoffs principle states?

A

The security of a cipher should rely only on the secrecy of the key and not on the secrecy of the cipher.

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

What are the black box attack models ?

A

Models where the atacker only see what goes in and out the cipher.

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

What is Ciphertext-only attack model?

A

Passive attack, can´t perform decrypt and encrypt queries. JUST OBSERVE CIPHERTEXTS.

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

what is Known-plaintext attack model?

A

Passive attack, can´t perform decrypt or encrypt queries. OBSERVE CIPHERTEXTS AND THEIR ASOCIATED PLAINTEXTS. (the plaintexts are randomly chosen)

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

What is chosen-plaintext attack model?

A

Active attack. Can perform encryption queries of plaintext of their choise.

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

What is chosen-ciphertext attack model?

A

Active attack. Can perform encryption and decryption queries.

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

What are the grey-box attack models?

A

Models where an attacker also know the ciphers implementation.

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

What is an example of grey-box attack model?

A

Side channel attacks.

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

What is a side-channel attack?

A

Observe or measure analog characteristics of a ciphers implementation but do not alter the implementation. (non-invasive)

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

What are examples of side-channel attacks?

A

On software error messages, return values and on hardware measure of power consumption, electromagnetic emanations, etc.

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

What are the two main security goals?

A

Indistiguishability: Ciphertexts should be indistinguishalbe from random strings. Ej. If an attacker picks two plaintexts and the recieves a ciphertext of one of them, he should not know from which plaintext is.
Non-malleability: Given a ciphertext C1 it should be imposible to create another ciphertext C2 whose corresponding plaintext (P2) is related to (P1) in a meaningfull way.

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

What is a security notion?

A

Is a combination of a security goal and an attack model.

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

What is semantic security?

A

Is the same as IND-CPA. Ciphertexts should not leak any information about their plaintexts as long the key is secret. So, if an attacker can execute queries of encryption (CPA) two plaintexts that are equal should have different ciphertexts.

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

How can we achieve IND-CPA?

A

Using randomized encryption. Basically E(K,P,R) where R are random bits (IV,Tag).

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

If a cipher is IND-CCA implies that is IND-CPA as well?

A

Yes

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

If a cipher is NM-CCA implies that is NM-CPA as well?

A

Yes

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

If a cipher is IND-CPA implies that is NM-CPA as well?

A

No

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

If a cipher is NM-CPA implies that is IND-CPA as well?

A

Yes

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

What is the difference between symmetric and assymetric encryption?

A

Symmetric: One key that is shared between two parties.
Asymmetric: We have a pair of keys, priv and pub.

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

Can we derive a private key from a public key?

A

No

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

Can we derive a public key from a private key?

A

Yes

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

What is called encrypting with a public key?

A

Encryption, because only the holder of the private key can read it.

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

What is called encrypting with a private key?

A

Signature, because all with access to the public key, can read the message, so no confidentiality is gained.

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

What is authenticated encryption?

A

Is a type of symmetric encryption that outputs a ciphertext and a Tag. On the decryption process, the cipher takes K, C and T (the tag) and only returns a plaintext if the Tag matches the plaintext, if not, aborts.

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

What guaranties does authenticated encryption gives?

A

1- Integrity: The message is only decrypted if the Tag matches the plaintext.
2- Authentication: The person or process that sends the encrypted text, key and Tag gives more information about the authenticity.

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

What is an effective way to avoid a replay attack?

A

Set a counter, the evesdropper will not be able to forge the counter+1 message, so the reply will fail.

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

What is AEAD?

A

Authenticated encryption with adicional data is an extension of authenticated encryption where some part of the payload must be unencrypted.

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

What is format preserving encryption?

A

A type of encryption that creates ciphertexts that have the same format as the plaintext. Ej. Encrypt IP’s to IP’s, etc.

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

What is Fully homomorphic encryption (FHE)?

A

A type of encryption that let a user to update a ciphertext without decrypting it. It is useful on cloud scenarios, where you do not want you provider to know your encryption key, so you can send encrypted data and update other encrypted data without a key.

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

What is Searchable encryption?

A

Is a type of encryption that let you search for content without decrypting that content.

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

What is tweakable encryption?

A

Is a type of encryption that takes a key, a plaintext and a tweak. The tweak is a type of value that depends on the context, to avoid other contexts to decrypt that data. For example, on disk encryption, the tweak is set as the sector number or the block index.

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

What is identity-based-encryption?

A

Basically use email addresses in replace of public keys to encrypt a message. There is a central entity that handles the encryption keys and based on the identities generates privates keys to read the messages being sent (Generally using a PKG)

51
Q

What is attribute based encryption?

A

Attribute-based encryption is a one-to-many public key encryption. Only the user, whose attributes satisfy the access policy set by the encryptor, can decrypt the ciphertext. This concept originates from identity-based encryption

52
Q

What is oblivious transfer protocol?

A

In cryptography, an oblivious transfer (OT) protocol is a type of protocol in which a sender transfers one of potentially many pieces of information to a receiver, but remains oblivious as to what piece (if any) has been transferred. (https://www.cs.princeton.edu/courses/archive/fall07/cos433/lec19.pdf)

53
Q

What is functional encryption?

A

In a functional encryption system, a decryption key allows a user to learn a function of the encrypted data.
For example: As a concrete example, consider a cloud service storing encrypted images. Law enforcement may require the cloud to search for images containing a particular
face. Thus, the cloud needs a restricted secret key that decrypts images that contain the target face, but reveals nothing about other images. More generally, the secret key may only reveal a function of the plaintext
image, for example an image that is blurred everywhere except for the target face

54
Q

Why padding is important on block ciphers?

A

Because the length of the plaintext should be a multiple of the block length. Padding is used to fill that gap.

55
Q

What are padding examples?

A

Pkcs5, pkcs7, ansi x923, w3c padding, etc.

56
Q

What is a uniform distribution?

A

Occurs when all probabilities in the distribution are equal, meaning that all outcomes are equaly likely to ocurre.

57
Q

How is randomness linked to uniform distribution?

A

Any random process must produce outputs with the same probability of outcome: a uniform distribution.

58
Q

What is entropy?

A

A measure of uncertainty, or a measure of information. Both are valid definitions.

59
Q

What is the entropy of a 128 bits key generated with a uniform distribution function?

A

128 bits. Formula: 2^128 * (-2^128*log(2^-128))

60
Q

What is the entropy of a fair toss coin?

A

1 bit. Formula: -1/2 * log(1/2) - (1/2) * log (1/2)

61
Q

What is the entropy of a loaded coin with 1/4 prob of tails and 3/4 prob of heads?

A

0.81 bit. Formula: -1/4 * log (1/4) - 3/4 * log(3/4)

62
Q

In which probability distribution, the entropy is maximized?

A

In a uniform distrubution.

63
Q

Where true randomness is generated?

A

Can´t be generated in a computer because is a deterministic machine. It comes from RNG that usually are software or hardware that measure physical events.

64
Q

What a hardware random number generator measure to produce random numbers?

A

Temperature, acustic noise, electrical static, quantum events.

65
Q

What a software random number generator measure to produce random numbers?

A

Use attached sensors to measure events, I/O from mouse, packets from the network, disk activity, key pressing, etc.

66
Q

Why we do not use RNG directly?

A

Because RNG measurements are slow and because they do not have a uniform distribution, meaning low entropy.

67
Q

What are PRNG?

A

PRNG are algorithms that take RNGs inputs and produce random-looking bits in a deterministic way. (Using drng)

68
Q

How PRNG works?

A

They take true random bits from a RNG, feed them into a DRNG that expands those bits into a much larger sequence.

69
Q

What are the 3 main parts of any pseudo random number generator?

A

1- init() Initialize the entropy pool and the prng internal state (buffers, etc)
2- refresh(seed) updates the entropy pool using a specific seed.
3- next(n) runs the DRNG and return n pseudorandom bits and updates the entropy pool to make sure the next call will generate different sequences.

70
Q

What properties must have a CSPRNG?

A

1- produce bits sequences with a uniform distribution.
2- backtracking resistance: if an attacker knows one bit sequence, he can’t deduce previous bits.
3- prediction resistance: If an attacker reads part of the stream, he can’t know without a seed, the next bits.

71
Q

What is linear combination?

A

Xor combination of bits. This produce short equations and is why is not secure for cryptography in general.

72
Q

What is non-linear combinations?

A

Adds AND combinations. This rise equations to exponential sizes, practically unsolvable.

73
Q

What are statistical tests on PRNG?

A

Tests suites that produce samples of any specific PRNG and compute some statistics on its output distribution. The goal is compare this output with a uniform distribution. One example is amount of 0 and 1 on a stream.

74
Q

What is the difference between /dev/random and /dev/urandom?

A

Random tries to estimate the entropy of the pool, and if is not sufficient it blocks the stream. Urandom do not check this bound, and sends the stream anyway.

75
Q

What is rdrand?

A

Is an intel processor assembly instruction that generates pseudorandom bits.

76
Q

How rdrand works?

A

It has a small hardware circuit that jumps between 1 and 0 depending on thermal noise flactuations, usually 800MHz.

77
Q

From a performance view, is base64 or hexa a better encoding binary-to-text encoding to compare 2 digests?

A

Base64 because it provides less amount of characters than hexa to represent the same amount of information. This is why the text comparisons are more efficient.

78
Q

What are the drawbacks of using base64 to represent a digest?

A

Base64 has characters like “+” or “=” that can break some contexts such as http query strings.
Base64 has min and mayus, this means that if a developer could make an error of passing to minus all before comparing, this could lead to problems.

79
Q

What is perceptual hashing and piecewise hashing?

A

There are two types of hashes that gives information about the similarity of two inputs.

80
Q

What is the difference between informational security and computational security?

A

Informational security is about theoretical impossibility whereas computational security is about practical impossibility.

81
Q

When a cipher is informationally secure?

A

When even given unlimited time and resources it can not be broken.

82
Q

When a cipher is computationally secure?

A

When it can not be broken with a reasonable amount of time and resources,

83
Q

What means that a cipher is t-bit-secure?

A

Means that a successful attack needs at least t operations. 2^t operations are needed for a successful attack. It is an upper bound, the worst case scenario.

84
Q

If we need 10000000 operations to break a cipher, what is the security level?

A

is log2(10000000) = 2^20 -> 20 bits security.

85
Q

When a security level is lower than the key size?

A

1- When an attack could recover the key in less operations.

2- When speaking about public key algoritms.

86
Q

What is the bit security level of RSA 2048?

A

100 bit security.

87
Q

Say we have two 128 bits secure ciphers, but one is way slower than the other. Does this means that the slower one is more secure even if both are 128bits secure?

A

Yes

88
Q

What factors affect the cost of a successful attack other than the t-bit security?

A

1- Parallelism: If the attack could be carried out in different cores, the security is lower, because the attack is faster.
2- Memory: The time and space that the algorithm takes to process must be taken into account.
3- Pre-computation: The security of a cipher diminish a lot if you can harvest pre work and use it on posterior attacks. Ej. Meet in the middle de 3DES.
4- Number of targets: If you have 1 128bit key target, you will need 2^128 operations, but if you are searching 100 128 bit keys, the cost is 100*2^128. If you are looking at least one key on a set of 2^16 128 bit keys, you will take 2^128-16 = 2^112 operations.

89
Q

What Moore´s law state?

A

Computing efficiency doubles roughly every to years. We can think this as we loose 1 bit security every year.

90
Q

What is provable Security?

A

An approach used to mathematically proof the security of an algorithm. Proofs that breaking the algorithm is at least as hard as solving another problem hard to solve. This means the crypto remains safe until that problem is solved, this is called reduction.

91
Q

What approaches can we use to proof an algorithm is secure?

A

1- Relative to a math problem: Break an algorithm is as hard as resolve a math problem. (Prime number factorization)
2- Proofs relative to another crypto Problem: Compare with another crypto scheme, so if you can break that you can break this.

92
Q

Are this proofs of security absoult?

A

No, there are cavets.

1- Some times resolve math problemas are easier than expected.
2- Although the proof is good, the implementation could be wrong.

93
Q

What is heuristic security?

A

There are algorithms than can not be proved in a mathematical way. The only reason to trust this algorithms is because many skilled people tried to break it and failed.

94
Q

What type of scheme is paillier cryptosystem?

A

Additive homomorphic cryptosystem

95
Q

What are the 3 ways available to store a secret secure?

A

1-key wrapping: encrypting a key with a second key.
2- on the fly generation from a password: there is not key to store, because the key is derived from a password that lives on our brain. (ios pin iphone unlock)
3- storing a key on a hardware token with anti-tampering properties.

96
Q

What means a block cipher to be secure?

A

It should be a pseudorandom permutation. This means that as long as the key remains secret, there is no way to get the input that produced some output.

97
Q

What are the two most important sizes on a block cipher?

A

The block size and the key size.

98
Q

What is the impact of huge blocks on block ciphers?

A

1- More ciphertext overhead.

2- more memory footpirnt.

99
Q

In block cyphers, do block size affect performance?

A

Yes! 128 bit blocks are faster than 64bits depending on cpu arquitecture. There are native instructions like avx that made faster 128bits operations.

100
Q

In block cipher, if blocks are very small, is there a problem?

A

Yes, they are vulnerable to codebook attacks!

101
Q

What are codebook attacks?

A

If blocks are very small, say 16 bits, you can build a lookup table with all the 2^16 ciphertexts corresponding to every 16bit plaintext.

To decrypt you just find the corresponding input for the given output.

102
Q

Speaking of codebook attacks against small block sizes on block ciphers, how much memory do you need to build the lookup table on 16bit, 32bit and 64bit blocks?

A

16bit: 2^16*16 = 2^20 = 128KB
32bit: 16 gigas
64: 128 hexabytes

103
Q

What are DIEHARD, crypt-x, or. NIST-STS?

A

Statistical tests for randomness!

104
Q

What is Multisig on a cryptocurrency space?

A

Is a protocol that requires more than 1 party to sign a transaction. This avoids that if a single priv key is leaked, the wallet is at risk.

Generally speaking, multisig is integrated with the cryptocurrency ledger, meaning that is not an agnostic of the cryptocurrency.

Bitcoin uses Schnorr signatures and Monero uses edwards25519.

105
Q

What is Shamir Secret Sharing?

A

Shamir’s Secret Sharing is used to secure a secret in a distributed way, most often to secure other encryption keys. The secret is split into multiple parts, called shares. These shares are used to reconstruct the original secret.

Require n participants to SEND the shares of the final key to the system.

The construction is based on that 2 points are sufficient to define a line, 3 points are sufficient to define a parabola, 4 points to define a cubic curve and so forth.

106
Q

What is a threshold in SSS?

A

A threshold is used to denote the minimum number of shares needed to unlock the secret. For example, you can generate 30 shares but need 20 to unlock the final key.

107
Q

What are the variants VSSS and PSSS?

A

VSSS allows participants to verify that malicious shares are not being used, and PSSS allows participants to proactively rotate their shares.

108
Q

What is native multisignature?

A

Require n participants to SIGN the same transaction and send the n signatures to the system. The system must verify all.

109
Q

What is aggregated multisignature?

A

Require n participants to SIGN the same transaction and send the n signatures to an aggregator. The aggregator allow you to compress the n signatures in a single signature. THEN you send the signature to the system.

110
Q

What is a sybil attack?

A

En un ataque Sybil, un atacante puede contaminar un sistema distribuido creando un gran número de identidades que aparenten ser independientes y usarlas para obtener una influencia desproporcionada, alterar rutas o modificar contenido almacenado de forma redundante.

111
Q

What are examples of sybil resistant protocols?

A

Poof of work and proof of stake.

112
Q

What is threshold secret signature? And what is the difference with the SSS?

A

Instead of sending the part of the secrets for a centralized entity transform them into the final key, you send signatures directly to this central entity and this entity will generate a new final signature based on the sum of the other signatures.

113
Q

Which scheme is more “thresholdizing”, EdDSA or ECDSA? (Meaning that is more friendly with the concepto of devide the secret key in lots of shares)

A

EdDSA or pure Schnorr signatures, which
are relatively threshold-friendly thanks to the linearity of
their s computation.

114
Q

What is called sharding in distributed key management?

A

Is the concept of generating one single key, brake it in multiple part, using for example, shamir secret sharing, and then store then separately on different shards.

115
Q

What are hash levels?

A

Until now hash functions have generally been categorised as either cryptographic or non-cryptographic. However, there are several different hash function capabilities that are useful for different purposes.

116
Q

What means to be level 1 hash?

A

It means non collision resistant and are useful for cases where there are absolutely no adversaries.

117
Q

What means to be level 2 hash?

A

Level 2 hash functions usually receive a key as an input and can not produce a c-way multicollision.

118
Q

What means multi-collision resistance?

A

Is a natural relaxation of fully collision resistance. Roughly speaking, a shrinking hash function is multi-collision-resistant if finding many (rather than two) inputs that hash to the same output is intractable.

The notion of multi-collision resistance provides a
framework for proving formal security guarantees for standard keyless hash functions, for example SHA-2

119
Q

Can a keyless hash function achieve fully collision resistance?

A

No. Full collision resistance cannot be satisfied by any single (fixed) function. Indeed, for any shrinking function, there exist algorithms that can efficiently find collisions, by simply having such collisions hardwired in their code. Accordingly, in the theoretical treatment of collision-resistance, we consider keyed families of hash functions, requiring that efficient algorithms cannot find collisions when the key is chosen at random

120
Q

What is fully collision resistance?

A

Is a stronger claim than collision resistance.

Full collision-resistance requires the intractability of finding collisions, EVEN with full-adaptive access to a collision-finding oracle, meaning:

Here, the adversary gets access to a collision-finding oracle, which outputs a collision for the adversarially chosen hash, but also keeps track of each of the queried and returned hash/message pairs (h, m) and (h, m0 ), using the list Q. The adversary wins, if it comes up with a hash/message pair (h∗ , m∗ ) colliding with (m0∗, r0∗), for the given public key, where (m0∗, r0∗) was never queried to or output from the collision-finding oracle.

121
Q

What is the SAS 70 standard?

A

Is a set of best practices for root key ceremonies.

122
Q

What is the difference between RSA-PSS and RSA-OAeP?

A

OAEP = Encryption , PSS signature!

123
Q

What is zero knowledge proof?

A

In a zero-knowledge proof protocol, one party, the prover, proves to another party, the verifier, that a statement is true, while preserving confidentiality of information.

124
Q

what is a Polynonce attack?

A

When using ECDSA, reusing a nonce for multiple signatures (because a bug or a bad PRNG) lead an attacker to obtain the private key just using a little number of signatures. https://eprint.iacr.org/2023/305.pdf