Ciro Santilli OurBigBook.com \$£ Sponsor €¥ 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱

# Cryptography

articles: 1

## Symmetric and public-key cryptography

words: 594 articles: 17

### Symmetric-key algorithm

words: 80 articles: 4

#### Provably secure symmetric-key algorithm

words: 18
There aren't any 2020, except in the trivial one-time pad case where the key is as large as the message: crypto.stackexchange.com/questions/10815/how-do-we-prove-that-aes-des-etc-are-secure

words: 45
The only perfect cryptosystem!
The problem is that you need a shared key as large as the message.
Systems like advanced Encryption Standard allow us to encrypt things larger than the key, but the tradeoff is that they could be possibly broken, as don't have any provably secure symmetric-key algorithms as of 2020.

words: 17 articles: 1
##### Is AES quantum resistant?
words: 17
2020-so-far yes, Grover's algorithm would only effectively reduce key sizes by half:
but there isn't a mathematical proof either.

### Public-key cryptography

words: 514 articles: 11
It allows you to do two things:

#### Digital signature

words: 7
One notable application: cryptocurrency, see e.g. how Bitcoin works.

#### Ring signature

words: 12
Used for example:

#### Public-key cryptosystem

words: 336 articles: 3
##### RSA (cryptosystem)
words: 336 articles: 2
Based on the fact that we don't have a P algorithm for integer factorization as of 2020. But nor proof that one does not exist!
The private key is made of two randomly generated prime numbers: and . How such large primes are found: how large primes are found for RSA.
The public key is made of:
• n = p*q
• a randomly chosen integer exponent between 1 and e_max = lcm(p -1, q -1), where lcm is the Least common multiple
Given a plaintext message m, the encrypted ciphertext version is:
c = m^e mod n
This operation is called modular exponentiation can be calculated efficiently with the Extended Euclidean algorithm.
The inverse operation of finding the private m from the public c, e and is however believed to be a hard problem without knowing the factors of n.
However, if we know the private p and q, we can solve the problem. As follows.
First we calculate the modular multiplicative inverse. TODO continue.
###### How large primes are found for RSA
words: 91
Answers suggest hat you basically pick a random large odd number, and add 2 to it until your selected primality test passes.
The prime number theorem tells us that the probability that a number between 1 and is a prime number is .
Therefore, for an N-bit integer, we only have to run the test N times on average to find a prime.
Since say, A 512-bit integer is already humongous and sufficiently large, we would only need to search 512 times on average even for such sizes, and therefore the procedure scales well.
###### RSA vs Diffie-Hellman
words: 86
As its name indicates, Diffie-Hellman key exchange is a key exchange algorithm. TODO verify: this means that in order to transmit a message, both parties must first send data to one another to reach a shared secret key. For RSA on the other hand, you can just take the public key of the other party and send encrypted data to them, the receiver does not need to send you any data at any point.

#### Diffie-Hellman key exchange (DHKE)

words: 43 articles: 1
Based on the fact that we don't have a P algorithm for the discrete logarithm of the cyclic group as of 2020, but we do have an efficient algorithm for modular exponentiation. But nor do we have proof that one does not exist! Living on the edge as usual for public-key cryptography.

#### Elliptic curve cryptography

words: 109 articles: 2
##### Elliptic-curve Diffie-Hellman (ECDH)
words: 109 articles: 1
The algorithm is completely analogous to Diffie-Hellman key exchange in that you efficiently raise a number to a power times and send the result over while keeping as private key.
The only difference is that a different group is used: instead of using the cyclic group, we use the elliptic curve group of an elliptic curve over a finite field.
###### Diffie-Hellman vs ECDH
words: 39
ECDH has smaller keys. youtu.be/gAtBM06xwaw?t=634 mentions some interesting downsides:
• bad curves exist, while in modular, any number seems to work well. TODO why?
• TODO can't find this mentioned anywher else: Diffie-Hellman key exchange has a proof that there is no algorithm, ECDH doesn't. Which proof?

## Encryption

words: 50 articles: 7

### Disk encryption

words: 50 articles: 3

#### Can a smartphone's PIN or password be brute-forced in an offline attack?

words: 29
Ciro Santilli has a hard time understanding why this is possible, e.g. many people use short 4 digit pins, or a short swipe pattern. Why can't this be cracked easily offline?

#### Disk encryption password handover plausible deniability

words: 21
Can we do better than "wrong password implies random bytes"?
Can the last disk access times be checked via forensic methods?

## GNU Privacy Guard (GnuPG, GPG)

words: 68
Generate public private key, test encrypt and test decrypt:
# Create your pubkey.
gpg --gen-key
gpg --armor --output pubkey.gpg --export <myemail>

# Encrypt using someone's pubkey.
gpg --import pubkey2.gpg
echo 'hello world' > hello.txt
gpg --output hello.txt.gpg --encrypt --recipient <other-email> hello.txt

# Double check it is not plaintext in the encrypted message.
grep hello hello.txt.gpg

# Decrypt.
gpg --output hello.decrypt.txt --decrypt --recipient <myemail> hello.txt.gpg
diff -u hello.decrypt.txt hello.txt

## Internet privacy

words: 67 articles: 12

articles: 1

### Tor (anonymity network)

words: 67 articles: 7

#### Onion service

words: 67 articles: 3
This is a way to host a server that actually hide the IP of the server from the client, just like Tor hides the IP of the client from the server. Amazing tecnology!
This is why it enables hosting illegal things like the Silk Road: law enforcement is not able find where the server is hosted, and take it down or identify the owner.
##### Onion service search engine
words: 9 articles: 1
###### Uncensored Onion service search engine
words: 9
This is where "fun" stuff is likely to be.

## Ciphertext, plaintext, key and salt

words: 25 articles: 4

### Key (cryptography)

words: 25 articles: 2

#### Pre-shared key

words: 25 articles: 1
An overview of what you can do with a pre-shared key with tradeoffs can be found at: quantumcomputing.stackexchange.com/questions/142/advantage-of-quantum-key-distribution-over-post-quantum-cryptography/25727#25727 The options are:
words: 1

## Man-in-the-middle attack (MITM)

words: 76 articles: 1

### Authentication (cryptography)

words: 76
In the context of cryptography, authentication means "ensuring that the message you got comes from who you think it did".
Authentication is how we prevent the man-in-the-middle attack.
Authentication is one of the hardest parts of cryptography, because the only truly secure way to do it is by driving to the other party yourself to establish a pre-shared key so you can do message authentication code. Or to share your public key with them if you are satisfied with the safety of post-quantum cryptography.