Authentication and access control Flashcards
Define closed design
A type of design where the actual algorithms, and implementation itself are kept secret.
However, secrecy is not the same as security, and a closed design will not be considered secure just because of the secrecy aspect.
What is open design (Kerckhoffs principle) ?
The implementation, design pattern or algorithm themselves are known, but the system uses a secret input (a key) that is required for en- and decryption.
This allows for algorithms to be public without causing any data leak
What is cryptanalysis?
A type of attack where an attacker tries to find out the secret key.
An example is when the attacker has access to the plain text and the ciphertext, and attempts to figure out the key based on these.
What is a brute force attack?
A cryptanalysis attack where an attacker tries to guess a secret key by checking all possible keys.
How can you protect against brute force attacks?
Making sure the key space is so big that an attacker wouldn’t be able to go through them all.
What happens during a man-in-the-middle attack
If we have to subjects, A and B, communication. A third subject C can place themselves in the middle of A and B, and by doing they pretend to be subject B for A, and pretends to be subject A for B.
What is symmetric key cryptography?
The sender and the receiver share a common key.
Encryption and decryption is done by using this key.
What are the main functions of symmetric key cryptography?
Need a routine, or a way, of generating the shared key.
Need a safe channel to communicate the key between the two trusted parties
Routine for encryption
Routine for decryption
What is One Time Pad?
The key is the length of the plaintext, and randomly generated.
Exclusive “or” is used on the plaintext from the key.
If an attacker tries to compute a message from the ciphertext, they wouldn’t know when they have the original message. Every possible message that can be computed from the cypher text is just as likely to be the plaintext.
Provides complete secrecy in theory
Why is the One Time Pad not widely used?
The burden of creating the keys itself is so big that it is no longer practical.
What algorithms is a symmetric cryptography cryptosystem composed of?
KeyGen(L): Key generating algorithm, L: length of key
Enc(K,M) -> C: Encryption algorithm, K:Key, M:Message, returns C:Ciphertext
Dec(K,C) -> M: Decryption algorithm: K: Key, C: Ciphertext, M:Message
Describe the Caesar cipher(Shift cipher)
Each letter is shifted a certain number of places down the alphabet.
Enc = M + K(mod 26)
Dec = C - K(mod 26)
Why isn’t the Caesar cipher secure?
Small key space - number of letters in the alphabet
What is DES (Data encryption standard)?
Internal structures: Feisel, S-boxes, permutations, shifts, XORs
Should not be used - not secure
What is triple DES?
An decryption algorithm using three DES operations
What is AES (Advanced encryption standard)?
Todays standard when using symmetric cryptography
Name 6 symmetric key ciphers, and what they are used for.
IDEA: Used in PGP
Blowfish: Password hashing in OpenBSD
RC4: (used in WEP), RC5
Double DES, Triple DES
SAFER: Bluetooth
AES: Pervasive
What is asymmetric cryptography (public key cryptography)?
Every user has two keys
Public key (E): Released to everyone who wants to send a message, used for encryption
Private key (D): Known only to the user using it, used for decryption
The need to share secrets between the communicating parties is alleviated.
You release your public key to the world. People use the public key to encrypt the messages. Only you, with the private key, can decrypt the messages.
Because of how the decryption- and encryption systems work with public key cryptography, these processes are slower than during symmetric key cryptography
Requires very large key spaces. This is because there aren’t that many prime numbers. Minimum 2048 bit key space
What are two problems with symmetric cryptography, that asymmetric cryptography alleviates?
When using symmetric cryptography system, the communicating subjects first need to share the key over a channel, meaning it is very important to ensure this channel is safe. When using public key cryptography there is no need to share keys, removing this problem.
Also, for every N subjects that want to communicate, there is a need for N squared keys in the system. This number will increase quickly
What concept is very important in asymmetrical cryptography, and widely used in asymmetrical cryptography algorithms,
If you have a very large prime number, that is a product of two other primes, it is very difficult to figure out which two primes make up the factors.
For example, a private key would contain information about the two primes, whereas the public key could be any number which would later be used to compute inverses.
What concept is very important in asymmetrical cryptography, and widely used in asymmetrical cryptography algorithms,
If you have a very large prime number, that is a product of two other primes, it is very difficult to figure out which two primes make up the factors.
For example, a private key would contain information about the two primes, whereas the public key could be any number which would later be used to compute inverses.
What is the components of an asymmetric cryptography system?
KeyGen(L): Return K_pub, K_priv
Enc(K_pub, M) -> C
Dec(K_priv, C) -> M
NB: given K_pub, it is extremely difficult to compute K_priv
How does digital signatures work?
Encryption is done by using a private key, and decryption is done by using the public key.
C = Enc(K_priv, M)
M = Dec(K_pub, C)
This means that everyone can in fact read the message sent, as everyone will have access to the public key. However, no one would be able to substitute the original message with their own, as they do not have the private key to encrypt their own message.
Because of this, digital signatures can be used to confirm the identity of the sender.
Digital signatures work slow
What are the properties of cryptographic hash functions?
- Can apply to data of any length
- Output is fixed length
- Relatively easy to compute h(x), given x
- Deterministic, given the same x - h(x) will always output the same
- One-wayness property: Infeasible to get x, given h(x)
- Weak-collision resistance property: Given x, infeasible to find y such that h(x) = h(y)
- Strong-collision resistance property: Infeasible to find any pair x and y, such that h(x) = h(y).
How often does collisions occur?
For a hash of length n bits, a collision can be found in 2^(n/2) trials
How is hashes and digital signatures combined?
As creating a digital signature for a large message is an expensive process, we first create a hash of the data, and then a digital signature of that hash.
The clear text message is then sent along with the signed hash value of the text.
h = H(m), hash of message
S = Enc(K_priv, h), hash signature
The reciprient can then calculate the hash of the message and see if it matches:
h = H(M)
What is PKI? (Public key infrastructure)
A system for key distribution.
A PKI is a trusted server that will create signatures and sign things for their users.
Digital certificates are one of the fundamental building blocks of PKI.
What is digital signatures?
A mathematical scheme for verifying the authenticity of digital messages and documents.
A digital signature upholds properties of both authentication and integrity, by providing a strong reason for the recipient to know that the message indeed came from the given sender, and that the message was not altered in transit.
Describe the steps of signing some data with a digital signature.
Data -> hash function -> hash
S = Enc(K_priv, hash), create signature by encrypting the hash
Send signature + data = Digitally signed data
Describe the steps of verifying data that is signed with a digital signature.
First run the data through the has function.
H(M) = h
Then decrypt the signature with the signers public key.
Dec(S, K_pub) = h
Check if the two hashes are equal, only then can the data be verified
What is a digital certificate and what does it contain?
An electronic document proving ownership of a public key.
Contains:
- Information about the key
- Information about the identity of the owner (subject)
- The digital signature of an entity that has verified the certificate’s contents (issuer)
How is digital certificates used in PKI systems
PKI servers does not only need to verify who a message came from. They also need to provide information about the public keys themselves. For example, if and key have an expiration date, and when this might be.
A CA (Certification Authority) signs digital certificates and attest for the key and give information about this key.
This information includes things like
- why you know that this is a certain subject’s key.
- Who issued them
- Version number
How can PKIs be structured in a hierarchical way?
Have one CA that gives out certificates to all serves, devices and computers you want to issue them for.
CA -> User certificate, Server certificate, Device certificate
In practice, it is too burdensome for only one CA to handle all the certificates, making it more practical to implement multi-level hierarchies.
The root CA has the authority to issue certificates for certain entities. This entities can their own CA’s that can issue certificates to other sub-entities
Root CA -> CA_1, CA_2, User
CA_1 -> User_1, User_2, User_3
CA_2 -> User_4, User_5, User_6
PKI’s can use cross-certification, where two CA sign for each other. Trusting one of them will automatically lead to trusting the other
CA_1 - CA_2
CA_1 -> user1, user2, user 3
CA_2 -> user4, user5, user6
PKI’s can use bridge CA, where one CA acts as a bridge that certifies all the other CA’s, and all the others certify the bridge
How is certificates validated in practise where multi-level CA hierarchies are used?
The software will use Trust Path Building.
The software that is going to validate the certificate (browsers, etc..) are often pre-installed with a set of trusted certificates.
The software will then see if it can find a path of certificates from one of the certificates it trusts, down to the certificate the software is trying to get to. (Follow a chain of trust).
How is certificates validated in practise where multi-level CA hierarchies are used?
The software will use Trust Path Building.
The software that is going to validate the certificate (browsers, etc..) are often pre-installed with a set of trusted certificates.
The software will then see if it can find a path of certificates from one of the certificates it trusts, down to the certificate the software is trying to get to. (Follow a chain of trust)
What is cross certification?
Cross certification is when two CA’s sign for each other. Meaning, that if either of them is in a system’s trusted CA’s, you will be able to follow a trust path from them
What is Bridge CA?
When one CA operates as a hub, or a bridge CA, that sits in the middle of a lot of trust relationships. Meaning it validates a lot of CA’s and all the other CA’s certifies this bridge.
This structure does put a lot of paths through one CA, potentially causing issues
What components does PKI’s contain?
Certificate authority (CA): Responsible for issuing certificates
Registration authority (RA): Verifies the identity of the individual requesting a certificate
Certificate repository and revocation information: Hold information about which certificates are still valid
What does the registration authority do in PKI’s?
Verifies the identity of the subject requesting a certificates.
Tries to figure out why we would belive that the subject is who they say they are.
A subject or user would communicate directly to the registration authority by providing authentication of who you are, so you can obtain a certificate. How this authentication happen varies based on what type of certificate you are getting.
Registration authorities can be people but also machines and software
In what situations would it be necessary to revoke a certificate?
If private keys have been compromised.
Certification information is no longer valid.
KeyGen algorithm has been proven insecure.
Encryption algorithm has been proven insecure.
What is a Certificate Revocation List (CRL) ?
A certificate that list who you revoke trust in.
For each certificate in the list, its serial number, the time of revocation and reason for revocation is listed.
The CA will then sign it and communicate that these should no longer be trusted.
A system would need to download this list.
The CRL contains information about the key, which trust should be revoked, revocation data and signature.
Is released at a CDP (CRL Distribution Point)
Describe the revocation timeline
Key compromise event - Certification revocation request - CA signs Certificate revocation - new CRL is issued communicating to users the certificate can’t be used
What are some issues with CRL’s?
The revocation process takes a lot of time, burdensome, doesn’t work well in practise.
CRL’s can be generated very slowly because of how some CA’s may operate.
What is the Online Certificate Status Protocol (OSCP)?
A server tells you if a certificate has been revoked.
Preferable compared to CRL’s