Security Flashcards
Explain the difference between symmetric key and asymmetric key cryptography, and state and example application where each would be used.
• Symmetric key cryptography is where you just have one key (password) and the same key is used for both encrypting and decrypting the data.
• Asymmetric key cryptography is where you have a public and private key.
• An example of symmetric key cryptography is file encryption with a password, or any valid application where a single password is used.
An example of asymmetric key cryptography is any application or protocol where public-private keys are used, e.g. PGP, SSH, SSL, Bitcoin Wallets.
State four desirable properties of a cryptographic hash function.
• Deterministic - The same input always results in same hash
• One-way function: You should not be able to reverse the plain text from the hash.
• No collisions: you should not be able to find two different inputs with the same hash value
• Avalanche effect: changing 1 bit results in completely different output indistinguishable from any other hash. May also be called chaotic function or described accordingly.
Where if an input is changed slightly (for example, flipping a single bit), the output changes significantly
In the context of databases, explain and give an example of:
i. An obscure query.
An inference attack
Obscure query:
• This is where you hide your real query in a more complex query making it harder to identify the real query.
• Example would be an SQL query where you select data within complex logical conditions that ends up simplifying to a clearly malicious query. When reviewing the database logs, it now becomes more difficult to understand any malicious behaviour.
Inference attack:
• These occur when users combine multiple views of a database in order to illegitimately gain knowledge of a subject or sensitive data e.g. Through statistical inference. An alternative explanation is when someone is allowed to execute queried that they are authorized for, but by executing those queries they are able to gain access to information for which they are not authorized through inference of query results.
• Given a list of students and their colleges, and a list of fines by college, if we know Sarah is the only member of a particular college, we will be able to infer her fines. Alternatively, if we know that Jim and James are members of her college with zero fines, we can infer that both Jim and James are members of a college with zero fines, we can infer that both Jim and James also have zero fines.
Explain what “IP spoofing” is, and explain how you can protect against an IP spoofing attack.
• IP spoofing is the process of replacing the source IP address with a fake IP address from the IP packets to hide the real identity of the sender. The hacker can make it appear that the packet was sent by different computer system. This can be used for session hijacking, for example a user may think he is accessing a genuine page when he types in the URL but actually he is seeing a compromised page whereby the hacker can steal sensitive information.
• Protect with authentication based on key exchange and configuration of encrypted sessions.
• You can use an ACL to deny private IP addresses on the downstream interface.
• You can implement filtering of inbound/outbound traffic.
The router can be configures to reject packets from outside the LAN that claim to be originating from within.
Define a substitution cipher.
A substitution cipher is a method of encrypting by which units of plaintext are replaced with ciphertext, according to a fixed system; the “units” may be single letters, pairs of letters, triplets of letter, mixtures of the above an so forth.
Describe the differences between Monoalphabetic, Polyalphabetic and Polygraphic.
- Monoalphabetic - any cipher in which the letters of the plaintext are mapped to ciphertext letters based on a single alphabet key. For this reason, a monoalphabetic cipher is also called a simple substitution cipher. Remember mono - single, or one.
- Polyalphabetic ciphers uses multiple substitution alphabets.
In Polygraphic substitution a uniform substitution is performed on blocks of letters. When the length of the block is explicitly known, more precise terms are used: for instance, a cipher in which pairs of letters are substituted is bigraphic. Similar to polygraphic but groups are used.
- Polyalphabetic ciphers uses multiple substitution alphabets.
Describe SSH and what it can be used for.
- SSH, also known as Secure Shell or Secure Socket Shell, is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network.
- SSH is widely used by network administrators for managing systems and applications remotely, allowing them to log into another computer over a network, execute commands and move files from one computer to another.
- SSH uses client-server model
This is accomplished by generating a unique public key pair for each host in the communication;
How do public and private keys work?
Public key cryptography allows someone to send their public key in an open, insecure channel. Having a friend’s public key allows you to encrypt messages to them. Your private key is used to decrypt messages to you.
Describe block ciphers.
- A method of encrypting text in which a cryptographic key and algorithm are applied to a block of data (for example, 64 contiguous bits) at one as a group rather than to one bit at a time. (The main alternative method, used much less frequently, is called the stream cipher)
- So that identical blocks of text are not get encrypted in the same way in a message (which might make it easier to decipher the cipher text)
Describe side-channel attacks.
A side channel attack is any attack based on information gained from the implementation of a computer system, rather than weakness in the implemented algorithm itself.
What is a rainbow table?
- A precomputed table for reversing cryptographic hash functions
- Strings hashed -> stored in rainbow table
Lookup hash -> find string
- Strings hashed -> stored in rainbow table
What are salts?
- A random string stored in pain text alongside the hash, but we compute the hash by:
- Hash = H(salt + password)
Two different users with the same password will not have different hashes, as they will have differently randomly generated salts.
- Hash = H(salt + password)
What is an access control matrix (ACM)?
- An abstract, formal security model of protection state in computer systems, that characterizes the rights of each subject with respect to every object in the system.
- Easy to define and verify
Poor scalability, poor handling of changes, could get corrupted
- Easy to define and verify
Describe the 8 NIX access permission settings.
- — all types of access denied
- –x execute access only
- -w- write access only
- r– read only
- R-x read and execute only
- rw- read and write access only
rwx everything allowed
What is setuid and sticky bit?
- Setuid is Unix access rights flags that allow users to run an executable with permissions of the executable’s owner or group respectively and to change behaviour in directories.
Sticky bit is a user ownership access right flag that can be assigned to files and directories on Unix-like systems.
Describe link vulnerabilities.
E.g. When files give access to an unnamed file. An thus can be altered to access unauthorised files.
What are access control lists?
- Lists of users that have some sought of permission to access/read/execute a file.
- Easy to view access control, easy to remove access rights of object removed.
Poor overview of access rights per subject, difficult to remove subject.
- Easy to view access control, easy to remove access rights of object removed.
Describe capability based security.
- Each user holds a list of files which they have rights too, which also details their access right.
- Sorted by user rather than file. (subject focused)
- Easy to transfer ownership, easy inheritance of access rights.
Poor overview of access rights per object, difficulty of revocation of object.
Describe the Bell-LaPadula Model
- Uses access control lists
- A confidentiality policy “read down, write up” -> subject can only read down and write up
○ Simple security property -> Subject (Greg) cannot read objects of higher sensitivity
○ Star property - Subject cannot write to object of lower sensitivity
○ Strong star property -> subject cannot read/write to object of higher/lower sensitivity - The first goal of the Bell-La Padula security model is to prevent users from gaining access to information above their clearance.
○ E.g. A user with a lower classification should not be able to read files above them.
- A confidentiality policy “read down, write up” -> subject can only read down and write up