Cybersecurity Foundations
Cybersecurity Foundations HSR Vorlesung 1-5 PART 2: https://card2brain.ch/box/20200731_cysec_foundations_teil_2
Cybersecurity Foundations HSR Vorlesung 1-5 PART 2: https://card2brain.ch/box/20200731_cysec_foundations_teil_2
-
- 1 / 61
-
Flashcards
What different ways of data removing/erasing are possible
Erasing: only link to the data is removed, actual data remains on the drive
Clearing: Clearing or Overwriting is a process to preparing media for reuse and make sure that deleted data can not be recovered using traditional tools,
Purging: more intense from of clearing used in less secure environments
Degaussing: erasing data with a strong magnetic field from, does not affect CDs, DVDs and SSDs
Destruction: Destroy it in a way that it cannot be repaired.
How does the CIA triad look like?
a triad of
Confidentiality
Integrity Availability
Describe Integrty in the context of the CIA triad
Protecting the reliability and correctness of data
- Prevents unauthorized alterations of data
- Only authorized subjects can modify the data
- Alternations should not occur while the object is in storage, transit, or process
Data integrity implies information is known to be good, and the information can be trusted as being complete, consistent and accurate
System integrity implies that a system will work as it is intended to.
Examples: intrusion detection systems, hash verification
Describe availability in the context of the CIA triad
Authorized subjects are granted unlimited and uninterrupted access to objects.
Examples: Redundancy, maintain reliable backups, prevent data loss or destruction
Describe Confidentiality in the context of the CIA triad
Prevent or minimize unauthorized access to data. Allow authorized users access to the data and prevent it for everyone else.
Examples: encryption, access control
Describe Nonrepudiation & accountability
Nonrepudiation: records all actions, so that who caused the event cannot deny it was done by him/her
Accountability: Being responsible or obligated for actions and results
Examples: Nonrepudiation can be established using digital certificates, session identifiers, transaction logs.
Describe Copyright and how its used
- Protection against unauthorized dupliction
- Eight broad categories of works qualify for copyright protection. (Literary, musical, dramatic choreographic, graphical/sculptural works, audiovisual works, sound recordings, architectural works)
- Copyright only protects the acutal code but not the idea behind the code, means rewriting is allowed
- The copyright exists once something is created, it must not be registered, if you can prove in court that you were the creator of a work you will be protected under copyright law.
- You can mark your work with the copyright symbol (©) to protect it.
- Works by one or more authors are protected until 70 years after the death of the last surviving author.
- A work is considered “for hire” when it is made for an employer during the normal course of an employee’s workday.
Describe Trademarks and how they are used
- Words, slogans and logos identifing a company
- No need to register them
- ™ Symbol is used to mark protected words or slogans
- For official recognition it can be register at the «Eidgenössisches Institut für Geistiges Eigentum»
Describe Trade Secrets and how they are used
- Patent or copyright could be used for such information, but both of the m provide the protection just for a limited time period
- Trade Secrets are often used by big software companies to protect their core base of intellectual property.
Whats a Patent and is it usable for software
- Protect the intellectual property rights of inventors
- 20 years exclusive usage of the invention
- After 20 years the invention is public available for everyone to use
- Must be new, must be useful, must not be obvious
- Does not provide adequate protection for computer software products
What are assets of an organization
- Information: All data of an organization
- Systems: The system includes any services provided for / from the organization (IT)
- Devices: server, desktop computers, portable laptops, tablets, smartphones, external devices e.g. printers
- Facilities: all physical location that an organization owns or rents
- Personnel: Working for an organization
- Intellectual Property: Assets which are intangible (immateriel)
- Brand names
- Creative output
- Secret recipes or product techniques
What could happen if an asset is lossed or disclouserd
- An overall security compromise (security breach, security leck)
- Loss of productivity
- Reduction of profits
- Additional expenditures (Auslagen / Ausgaben)
- Discontinuation (Stilllegung / Unterbrechung) of the organization
- And more …
waht are the military and business data classifications
Military :
- Top secret
- Secret
- Confidential
- Sensitive but unclassified
- unclassified
The unauthorized disclosure of top-secret data will have drastic effects and cause grave damage to national security. The unauthorized disclosure of data classified as secret will have significant effects and cause critical damage to national security. The unauthorized disclosure of data classified as confidential will have noticeable effects and cause serious damage to national security. Sensitive but unclassified is used for data that is for internal use.
Business:
- Confidental / Private
- Sensitive
- Public
What is SSH, why is it used and what are the advantages compared to older technologies as e.g. ftp, telnet, rlogin ...
Secure Shell replaces unsecure remote configuration operations as e.g.: telnet, ftp, rlogin, rsh, rcp and rexec. Old commands and protocols transmit the content in plain text rather than encrypted format.
Advantages: encrypts data, offers different authentication methods e.g. password authentication, Pubkey Authentication
What is suspicious behaviour of a process?
process running with open network socket, that doesn’t show up on a similar system, network saturation (Ausnutzung) from a single host but nothing in the file system, programm eating up 100% CPU power but nothing in the file system
What is a reverse shell and a bind shell how do they work together and what can happen?
Bind Shell: Attacker connects to a victim on a listening port
Reverse Shell: Victim connects to attacker on listening port
Can be done with netcat, which then allows to transfer files
What is Scapy
Scapy is a phyton utility to send, sniff, dissect (aufgliedern) and forge (fälschen) ip packets. It’s used to:
- to create tools that can probe, scan or attack networks
- ist very powerfool for interactive packet manipulation
- used to create attack signatures for IDS/IPS systems
Whats the idea of Cypertext
A cryptographic algorithm is used to encrypt a plaintext message
Message, Plaintext --> [Encryption] -- Ciphertext --> [Decryption] --> Message, Plaintext
^----------------key-------------------^
What is Kerckhoffs's Princple
A cryptographic system must be secure even if everything about the system, except the key, is public knowledge.
- Algorithms are known public, anyone can text them
- «The enemy knows the system»
- Public exposure may help to find weaknesses more quickly
- Most believe in this principle, but some also think it’s saver to keep the key and the algorithm secret
What is a SP-Network
Uses repeated substitution (Replacing bytes with others) and permutation (Swapping bytes around) operations. Repeated for multiple rounds.
wikipedia: https://en.wikipedia.org/wiki/Substitution%E2%80%93permutation_network
How does the Caesar cipher work
To encrypt a message each letter of the alphabet is shift three letters to the right. It is a substitution cipher that is mono-alphabetic.
Example
Here’s an example of the Caesar cipher in action.
Khuh’v dq hadpsoh ri wkh Fdhvdu flskhu lq dfwlrq.
How does XOR work and why is it interessting for cryptographics
A function which takes 2 inputs returns true if one of the inputs is true and the other is false.
e.g.:
A B O
0 0 0
0 1 1
1 0 1
1 1 0
doing the process again with A and O gives back B again. This is very usefull, because this process can be thought of as A encrypting and decrypting B.
What is the one time pad
The one time pad uses XOR to encrypt and decrypt a message.
+ once the key is gone there is no way using statistics to retreive the original message
- the size of the key is the same as the file e.g. 1 GB file = 1GB key
- if a key is used more than once, the cipher is broken, because it can be reversed then
What is a stream cipher and which advanteages and disadvantages does it have
The idea is to create a one time pad by generating an infinite pseudo random-keystream
- Encryption of long continuous streams possible
- Extremely fast with low memory footprint à ideal for low-power devices
- If designed well it can seek (suchen, ermitteln) to any location in the stream
- The keystream must appear statistically random
- A key + nonce must never be reused
- Stream ciphers do not protect the ciphertext (no guaranteed integrity)
What does AES stand for, what kind of cryptogrphy is it and what are some key data about AES
AES (Advanced Encryption Standard) is a symmetric encryption standard built around the Rijndael algorithm.
- 128-bit block size
- Key length of 128 , 192 or 256 bits
- 10, 12 or 14 rounds
- Each round: SubBytes, ShiftRows, MixColumns, Key addition
Draw the AES process
→→→ Plaintext
↑ ↓
↑ XOR with key (k0, k1, k2, k3, …)
↑ ↓
↑ SubBytes (Confusion)
X rounds ↑ ↓
↑ ShiftRows (Diffusion)
↑ ↓
↑ MixColumns (Diffusion)
↑ ↓
←←←←←
What does each AES step do
XOR: A 128 bit Block (4Byte x 4Byte) is XOR with a part of the key, before starting round keys are created out of the «secret key», one of these round keys is used after/before each round.
Subbytes(): A funciton / lookup table, with no fixed point and no oppisite bit flap.
ShiftRows():
- First row is not changed,
- second is moved 1 to the left,
- third is moved 2 to the left and
- third is moved 3 to the left.
MixColumns: is done using a matrix multiplication. In a 128 bit block, all columns of 4 bytes are multiplied with a matrix (a Maximum Distance Separable Code is used, to have the highest possible hamming distance)
Why is a Mode of operations for block ciphers needed?
Realistically a message with the exact size of 128-bit is very unlikely, mechanisms are needed to encrypt longer messages.
A mode of operation is the ocmbination of multiple encryptions into a protocol
How does Electronic Code Book work and what are it's disadvantages?
Each block is encrypted after another. Weak to redundant data divulging (verbreiten / enthüllen) patterns.
Is not recommended.
How does Cipher Block changing work
XOR the output of each block with the next input, is not parallelizable, is better than ECB but no perfect
How does counter mode (CTR) work
Encrypting a counter to produce a stream cipher
- can be parallelized
- convert a block cipher into a stream
The message is not encrypted, a number is encrypted and uses the random number that comes out to XOR the message.
Standard mode for all encryption cipher (AES)
Which problem solves Diffie-Hellman
The problem is before a message can be encrypted the “secret key” must be shared with the communication partners over an insecure channel, this problem is solved with Diffie-Hellman
How does the Diffie-Hellman algorithm work
- Alice and Bob agree on base parameters.
p = a large prime number, is very big usually 2048-bit or 4096-bit
- = also a prime number must be a primiteve root of p e.g. 3 is a primiteve root of 7
- Alice and Bob select numbers as private keys
Alice chooses a private value at random
Bob chooses a private value at random
The private vlaues must be between 1 and . Is a 2048-bit number, which is never told to anyone
- Alice and Bob each calculate a public key
Alica calculates:
Alica calculates:
The public key is created using and to mathematically hide the private version.
- The puvlic keys are swapped over the wire
Alice sends the result of the calculation:
Bob sends the result of the calculation:
- The private key is combined with the others public key to create the shared “secret key”
Alice computes:
Bob computes:
- The shared secret is usually called the pre-master secret. It’s used to derive session keys
Whats the shared secret if applying the Diffi-Hlleman with the following numbers
g = 3, p = 29
Alicey private key: 23
Bob private key: 12
24, Lösungsweg in den Folien 4 S. 53
What are the two main use cases of RSA
- Encryption that only the owner of the public key can read. If you want to send a encrypted message to another network member just take his/her public key and encrypt the data with this key.
- Signing that must have been performed by the owner of the private key. If you want to trust a server he can send a message encrypted with his private key and you know by encrypting the message with his public key that ist him/her
What is the discrete logarithm problem
Discrete Logarithms:
3^29 mod 17 = x x is easy to determine
3^x mod 17 = 12 x is hard to determine, especially for big numbers, because the solution can only be found with brute force
The following variables for an RSA process are given, encrypt and decrypt the message "m" (89)
p1=53
p2=59
n=53*59 = 3127
ϕ(n)= 3016
e=3
d=2011
encryption:
c(MessageBob)= 893 mod 3127=1384
decryption:
c(MessageBob) = 1384 13942011 mod 3127 = 89
This is an example from the presentation 5 starting at page 27
Tell some facts about RSA
- RSA is very weak if encrypting short messages
- Padding is added in short messages, optical asymmetric Encryption padding (OAEP) is the used
- Introduces an IV into the process and then hashes it
- The receiver will have to use the exact same padding to make sure the messages match up
- It’s not common to see encryption done in RSA
- RSA is 1000x slower than symmetric crypto systems
The following variables are given, what does a signature process look like if the signature of Alice is "SignatureAlice=42"
p1=61
p2=53 n=3233
ϕ(n)= 3016
e=17
d=2753
Tom: c(SignatureAlice)= 42^2753 mod 3233=3065
3065^17 mod 3233 = 42 => SignatureAlice=42
Bob: c(SignatureAlice)= 42^2753 mod 3233=3065
3065^17 mod 3233 = 42 => SignatureAlice=42
Alice: c(SignatureAlice)= 42^2753 mod 3233=3065
Lösungsweg Präsi 4 S.34
Signing is encrypting with the private key
Whats the problem with RSA in a few years
RSA is going to become slower because bigger keys will have to be used.
- the main alternative is DSA (Digital Signature Algorithm) which uses
- DSA only works for signing
- it acts like RSA but uses mathematics similar to Diffie-Hellman