Docsity
Docsity

Prepara i tuoi esami
Prepara i tuoi esami

Studia grazie alle numerose risorse presenti su Docsity


Ottieni i punti per scaricare
Ottieni i punti per scaricare

Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium


Guide e consigli
Guide e consigli


Soluzioni esami control network security, Prove d'esame di Sicurezza delle reti

Soluzioni diversi esami di control network security

Tipologia: Prove d'esame

2019/2020

Caricato il 29/12/2020

nenzius
nenzius 🇮🇹

9 documenti

1 / 32

Toggle sidebar

Questa pagina non è visibile nell’anteprima

Non perderti parti importanti!

bg1
2012 09 13 !
1. Firme digitali e hashing!
Una firma digitale è solitamente realizzata calcolando uno hashing di un messaggio e
cifrando il risultato dello hashing attraverso la chiave private di colui che firma.!
!a.!Cosa potrebbe accadere se si verificasse una collisione nella funzione di hashing
usata per la firma? !
! ! Due messaggi hanno lo stesso hash implica che i due messaggi hanno la stessa firma.!
!b.!Quale potrebbe essere il possibile impatto di una tale collisione sulla sicurezza del
meccanismo di firma digitale? !
! ! Posso trovare un messaggio m2 con lo stesso hash del messaggio m1. L’utente firma
l’hash di m1. L’avversario può dire che m2 è stato firmato dall’utente perché m1 e
m2 hanno la stessa firma.!
!c.!Quali fattori condizioneranno l’impatto e quali azioni potrebbero essere intraprese
per mitigare l’effetto di tali collisioni (si considerino, ad esempio, le soluzioni
implementate in standard come PKCS e DSS)? !
PKCS: 0|1o2|8bytes|0 end of nonzero|message!
0 per assicurare signature h(m), 1 else 2 for encoding only message"
!! PKCS:!
! ! Invece di firmare l’hash del messaggio, firmo l’hash del messaggio concatenato a
byte casuali.!
!! DSS:!
! ! Uso SHA come hash e DSA come algoritmo:!
! ! Prima di firmare sommo all’ hash del messaggio una certa quantità che dipende sia da
numeri primi contenuti in chiave pubblica (che servono per la verification) che da
numeri segreti casuali che variano di volta in volta.!
! ! In questo modo è difficile che due messaggi abbiano la stessa firma anche se hanno
stesso hash. (i byte casuali dovrebbero coincidere). In dss you need per message
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Anteprima parziale del testo

Scarica Soluzioni esami control network security e più Prove d'esame in PDF di Sicurezza delle reti solo su Docsity!

1. Firme digitali e hashing Una firma digitale è solitamente realizzata calcolando uno hashing di un messaggio e cifrando il risultato dello hashing attraverso la chiave private di colui che firma. a. Cosa potrebbe accadere se si verificasse una collisione nella funzione di hashing usata per la firma? Due messaggi hanno lo stesso hash implica che i due messaggi hanno la stessa firma. b. Quale potrebbe essere il possibile impatto di una tale collisione sulla sicurezza del meccanismo di firma digitale? Posso trovare un messaggio m2 con lo stesso hash del messaggio m1. L’utente firma l’hash di m1. L’avversario può dire che m2 è stato firmato dall’utente perché m1 e m2 hanno la stessa firma. c. Quali fattori condizioneranno l’impatto e quali azioni potrebbero essere intraprese per mitigare l’effetto di tali collisioni (si considerino, ad esempio, le soluzioni implementate in standard come PKCS e DSS)? PKCS: 0|1o2|8≠bytes|0 end of nonzero|message 0 per assicurare signature h(m), 1 else 2 for encoding only message PKCS: Invece di firmare l’hash del messaggio, firmo l’hash del messaggio concatenato a byte casuali. DSS: Uso SHA come hash e DSA come algoritmo: Prima di firmare sommo all’ hash del messaggio una certa quantità che dipende sia da numeri primi contenuti in chiave pubblica (che servono per la verification) che da numeri segreti casuali che variano di volta in volta. In questo modo è difficile che due messaggi abbiano la stessa firma anche se hanno stesso hash. (i byte casuali dovrebbero coincidere). In dss you need per message

secret number In DSA p and q high prime number are chosen before continuing, private and public key are chosen according to these numbers

2. RSA a. Si assuma un sistema di cifratura RSA con p=23 e q= 29. L’esponente di cifratura è scelto pari a e=3. Determinare l’esponente di decifratura d. N = pq = 667 Z = (p-1)(q-1) = 616 scelgo e tale che (de-1) mod z = 0 3d mod 616 = 1 Provo 616 +1 è divisibile per 3? no Provo 6162 +1 è divisibile per 3? si d = 411 b. Mostrare che RSA è insicuro rispetto un attacco “chosen cyphertext”, in cui un attaccante che osserva c = me^ mod n può determinare m richiedendo la decifratura di c’ ≠ c. Suggerimento: sfruttare la proprietà omomorfica di RSA, secondo la quale (m1 m2)e^ mod n = (m1e^ mod n)(m2e^ mod n) mod n. cc’’ = (me^ mod n)(m’’e^ mod n) cc’’ mod n = (me^ mod n)(m’’e^ mod n) mod n cc’’ mod n = (m m’’)e^ mod n c’ = cc’’ richiedo la decifratura di c’. mi risponde con m * m’’. m’’ lo conosco, calcolo m = (mm’’)/m’’ 3. Autenticazione a. Descrivere dettagliatamente cosa è il Lamport’s Hash e come lavora. In quali casi risulta particolarmente utile? invece di fare H(password) faccio Hn(password) e conservo sul server sia Hn(password) e n. ogni volta che uso la password sul server sostituisco Hn(password) e n con Hn-1(password) e n-1. Quando n è vicina a 0 la password scade.

Consente al client e al server di autenticarsi. Si comunicano i propri cifrari disponibili in modo da scegliere il migliore comune. Il server invia il certificato e inizia lo scambio della chiave (opzionalmente richiede l’auth del client). (Il cliente opzionalmente si autentica) 2 random number and pre master key exchanged to generate session keys, If some steps fail, ssl fails. From random number exchanged both generate k material for encrypt decrypt. Connection establish untile the closure :P AUTH with mac Hash(MAC_secret_key || pad2 || hash(MAC_secret_key || pad1 || seqNum || SSLcompressed.type || SSLcompressed.length || SSLcompressed.fragment))

handshake!

Both of them are security layer in the protocol stack. The main difference is that SSL work between TCP and application while IPSec work on top of IP so can encrypt TPC segment. The first advantage of IPSec is that we can avoid IPspoofing but this cost in term of complexity of the architecture: each intermediate network node have to support IPSec and share private keys with other nodes moreover there is a problem of decrypting and encryption at each node. This also comport problem in the existent NAT system and required a new standard: NAT-T. All this problems are avoid with SSL that simply encrypt the payload of the TCP segments so we have a more practical protocol easy to use especially in application. b. Spiegare le ragioni per cui SSL permette a un intruso di ottenere più informazioni per l’analisi del traffico rispetto a IPSec. (Transport Layer Security (TLS) and its predecessor, Secure Sockets Layer (SSL)) SSL è tra livello applicativo e livello di trasporto. IPSEC è tra livello TCP e IP. Quindi con SSL sono in chiaro tutte le informazioni dell’header tcp, con IPSEC no.

L’amministratore di rete ha assegnato al gruppo i seguenti diritti di accesso ai file di una cartella usata dai membri del gruppo. La cartella contiene sia dati che applicazioni. Permessi del gruppo: esecuzione, visione del contenuto di cartelle, creazione file, creazione cartelle, cancellazione, lettura, presa possesso (proprietà). Quale modalità di controllo accessi è stata usata nell’assegnare i diritti di accesso? b1. Mandatory Access Control b2. Role-Based Access Control b3. Discretionary Access Control b4. Un controllo similare a quello del sistema operativo UNIX b3-b c. Spiegare la risposta alla domanda 5b Lo UNIX access control permette di creare un gruppo che contiene i quattro membri e dare a loro la proprietà del file e il permesso di lettura, scrittura, esecuzione e creazioni di cartelle e file. UNIX access control è un tipo di DAC che associa ad ogni oggetto un proprietario.

Short questions (no more than 5 lines per question)

  1. Which are the main characteristics of stream ciphers and of RC4 with other cipher we have seen in class? Dalla chiave genero uno stream lungo quanto il plaintext che XOR con il plaintext per ottenere il ciphertext. In RC4 generiamo una permutazione pseudo casuale che usiamo come stream. Un altro cifrario, per esempio il CBC è diverso da RC4 poiché il CBC è a blocchi: Il blocco Ci del ciphertext è generato criptando lo XOR tra il blocco Mi del plaintext e il ciphertext Ci-1. (Per la prima iterazione usiamo un seed).
  2. Cryptography can be used for many things. For example, it could be used to encrypt data to be archived on a tape for many years, or it could be used to protect a critical message being sent across the Internet. Are the issues of key selection the same or different for these two cases? Si, nel secondo caso basta un chiave che sia sicura al momento dell’invio e per un breve tempo a seguire, a seconda della segretezza del messaggio. Nel primo caso è necessario considerare che la chiave resti sicura per molti anni.
  3. MARCHETTI: Which is the main difference between a Firewall and an Intrusion detection system?

Un firewall blocca determinati pacchetti o permette solo alcuni pacchetti TCP e IP. Un IDS invece lavora a livello applicativo ed inoltre rileva un intrusione o un tentativo di intrusione.

  1. D’AMORE: DESCRIVERE COSA è UN BIRTHDAY ATTACK E IN QUALI SITUAZIONI ESSO VIENE UTILIZZATO Un attacco del compleanno è utilizzato per trovare collisioni di hash. Se noi abbiamo una fusione di hash D -> R e scegliamo sqrt(R) elementi di D, abbiamo una probabilità di collisione vicina al 50%. Even/Odd game Alice and Bob want to play the even-odd game (pari-dispari in italian), The game is as follows:
    1. Alice declare whether the sum of the numbers they will choose in step 2 will be odd or even;
    2. Alice and Bob each chooses a positive integer, let a and b the chosen numbers; and communicate the number to the other one. If the sum of the two number has parity equal to Alice’s choice then Alice wins; otherwise Bob wins. Here is the protocol (RA(a) denotes the encoding of a with key RA; assume that the encoding is secure) [Alice chooses odd or even and communicate her choice to Bob] A → B: odd/even [Alice chooses her number a and nonce RA] A → B: RA(a) [Bob chooses his number b and nonce RB] B → A: RB(b) Alice communicates RA and Bob knows a A → B: RA Bob communicates RB to Alice that now knows b B → A: RB

a. Dicuss the robustness of the protocol with respect to possible misbehaviour of Bob Bob ha due funzione di encoding. RB e RB’. Lui si trova un b pari e una b’ dispari tale che RB(b) = RB’(b’) b. Improve the protocol in order to make it fair (i.e. there is no possibility for Alice and Bob to cheat) Invece di usare una funzione di encoding uso una funzione di hash crittografica. Invece di comunicare solo la funzione, si scambiano sia l’hash function che il numero scelto. Così facendo l’altro può ricalcolarsi hash(valore) e confrontarlo con quello che gli aveva inviato l’altra persona.

AH:

trasport e tunnel: autentico tutto tranne campi mutabili

  1. Briefly describe the following services indicating whether they are provided by AH and ESP:
  • (^) Access control ESP
  • (^) Connectionless integrity AH e ESP
  • (^) Data origin authentication AH e ESP
  • (^) Rejection of replayed packets AH e ESP
  • (^) Confidentiality ESP Access control a. Briefly explain the main difficulties/problems in the realization of an access control policy (10 lines). Un access control serve per garantire che operazioni su alcuni oggetti vengano fatte solo da chi ne ha diritto. Esistono diversi tipi di Access Control. In base ai problemi da risolvere si sceglie un access control diverso. Se per esempio abbiamo bisogno che gli accesi siano regolati dagli utenti usiamo un DAC, altrimenti un MAC. Ogni access control si basa su soggetti e oggetti. In un DAC i soggetti possono garantire permessi ad altri soggetti a loro discrezione. Questo da problemi di Trojan Horse. MAC invece da accesso sfruttando regole tra classi di soggetti e oggetti. Tramite delle regole ( per esempio quelle di bell-lapadula, no read up, no write down), possiamo impedire attacchi di tipo trojan horse. In MAC però un soggetto non può dare permessi ad altri utenti per esempio. b. Doctors and volunteers have login accounts to the patient record system of a city. It is desired to implement these policies: (i) a doctor has access to the records (read/write) of all the patients who are assigned to him/ her, (ii) a voluteer is assigned periodically to a district, covering one or more patient addresses. She/he is assigned to at most one district at a time. At any given time, she/he has access to the records (only read) of all the patients currently in her district. Discuss which access control method is more suitable for this case and discuss how to implement these policies, focusing particularly on the suitability of capability lists and access control lists for each one. Usiamo una role based access control. Un dottore può accedere direttamente ai dati del paziente… disegno “database” diviso per vie raggruppate in distretti

2013 2 6

1. RSA a. Show how to use RSA in order to send long messages confidentially to Bob knowing his public key; your proposal should computationally efficient. E’ computazionalmente inefficiente criptare un messaggio lungo con RSA. Invio a bob una chiave di sessione simmetrica criptata con RSA e utilizzo questa per criptare il messaggio lungo. b. Show a possible attack to the simple RSA digital signature scheme that is based on chosen ciphertext and possible countermeasures. Vedere sopra. Per la countermeasure basta usare un pattern nel plaintext. scelgo un m’ -> c’ c=Cdascoprirec’ Cdascoprire’=mdascoprire modp c= c=Cdascoprirec’=mdascoprire modpm’modp Cdascoprirec’ modp= mdascoprire modpm’modp modp=mdascoprire m C=cdasoprc’ ottengo decifratura, quindi m mdascoprirem’=m -> mdascoprire=m/m’ dove m’ noto c. Describe the standard PKCS1; while presenting the different fields of the record discuss how they allow to eliminate possible weaknesses of the so called text book implementation of RSA. PKCS vedere prima (prima lo usavamo per evitare collision, ora per evitare l’attacco chosen ciphertext, in pratica mette un pattern al messaggio). 0|1o2|8B ≠0|0|h(mess) 0 per assicurare lunghezza non minore di n 1 per signature -> usiamo h(m) 2 per encoding .> usiamo m 8 non ero bytes to avoid collsion last 0 to show the end of the previous nonn zero bytes 2. Authentication We know that authentication of users can be based either on what you know , or on what you have , or on (who you are , or where you are. Present one authentication scheme for each of the above four different apporaches discussing briefly security requirements of each. what you know: password. Qualcuno usa un attacco dizionario o bruteforce o ti ruba la pwd in qualche altro modo. what you have: smart card. Se ti viene rubata la smart card ti viene rubato l’accesso. who you are: biometric tools. Dead people. Not stable over time

model can prevent them from illegally access private data? Discuss the

implications and the limitations of the approach.

Perché in DAC io posso avere la possibilità di leggere da un file f1 e scrivere ad

un altro file f2. Trudy che può leggere f2 ma non può leggere f1, installa un

trojan horse sul computer di Alice che ha entrambi i permessi. Il trojan così

copia il contenuto di f1 in f2, così che trudy può leggerlo.

MAC può prevenire i trojan horse, per esempio bell lapadula con la regole no

write down.

5. Short Questions (10 lines per question) a. Traffic analysis of a host consists in analysing the existing connections (IP, port, TCP etc.) of the host. Compare the robustness of SSL and IPSec with respect to a passive adversary able to perform traffic analysis. Vedere sopra b. Present an example of a “replay” attack and discuss how to cope with it. Suppose Alice wants to prove her identity to Bob. Bob requests her password as proof of identity, which Alice dutifully provides (possibly after some transformation like a hash function); meanwhile, Mallory is eavesdropping on the conversation and keeps the password (or the hash). After the interchange is over, Mallory (posing as Alice) connects to Bob; when asked for a proof of identity, Mallory sends Alice's password (or hash) read from the last session, which Bob accepts. 2013 9 16 1 Digital signatures and hash A digital signature is usually implemented by taking a hash of a message and encrypting the hash value with the private key of the signer. a) What could happen if a collision were found in the hash function used for the signature? b) What might be the possible impact of such a collision on the security of the digital signature mechanisms? c) What factors will affect the impact, and what things might be done to mitigate the effect of such collisions (refer, for example, to solutions implemented in standard like PKCS or DSS). Guarda sopra 2 Short questions a) Precomputations (computations performed before a message or a ciphertext becomes available) can be used to speed up the following cryptographic transformations. If the

answer is positive add one line of motivation. (Please note that multiple answers could be correct) A. AES decryption in the OFB mode B. AES encryption in the counter mode C. AES encryption in ECB D. AES decryption in the CBC mode E. RC4 encryption A. posso precomputare tutti gli Ek(seed), Ek(Ek(seed)). B. mi precomputo tutto gli Ek(seed), Ek(seed+1) etc. C. non c’è precomputation D. CBC non è parallelizzabile, per criptare m2 ho bisogno di C1 -> non c’è precomputation E. Mi precomputo lo stream. b) Show that RSA is not secure against a chosen ciphertext attack. In fact, if an attacker observes c = m e mod n , show how he can find m by requesting a decryption of c’, c’ different from c. Hint: use the homomorphic property of RSA stating that (m1 m2) e mod n = (m e mod n)(m e mod n) mod n. Guarda sopra c) The major weaknesses of the CBC mode of AES are ( add one line of motivation for each weakness and note that multiple answers may be correct): A. IV cannot be repeated for the same key B. IV must be kept secret C. encryption is more time consuming than decryption D. decryption cannot be parallelized E. the same plaintext block is always encrypted to the same ciphertext block F. exhaustive key search is easy to mount H. analysis of the ciphertext may reveal patterns (e.g., repeating blocks) in the plaintext A. WEAKNESS, Se Alice invia a Pippo e Pluto lo stesso msg con lo stesso IV. allora il ciphertext è uguale. B. FALSE, viaggia in chiaro. C. FALSE, sono gli stessi passi rovesciati. D. WEAKNESS. computazionalmente difficile. E. FALSE F. FALSE, perché non è facile trovare la chiave

The network administrator assigned the group the following access rights on all the files of a folder the group members will need in doing the job. The folders include data and programs. Allow: Execute Files , List Folders , Create Files , Create SubFolders , Delete , Read Permissions , Take Ownership. What access control strategy was used in assigning the access rights?

. a) Mandatory Access Control . b) Role-Based Access Control . c) Discretionary Access Control . d) A control similar to UNIX operating system c). Explain your answer to Question 5 b). LINUX, that is a DAC 2012 7 9

1. Digital signature

Answer the following questions, where x denotes the private key of

the signer.

  • With reference to a generic digital signature scheme, why

defining the signature as

Enc x (H(M)), rather than Enc x (M)? Discuss.

H(M) è facile da calcolare mentre l’encrypt richiede tempo. E’

computazionalmente meglio criptare l’hash.

  • Illustrate the PKCS standard for digital signature using RSA and

discuss the different fields

of the signed record.

0 || 1 || atleast 8 random non zero byte || 0 || H(M).

serve ad impedire che due msg con lo stesso hash hanno la stessa

firma.

  • Suppose Alice signs through DSA l documents M 1 , M 2 , ..., M l

using her private key x , but

she uses only l -1 different values for k (one value is used twice).

Can an attacker gain advantage from that?

Se i due msg che usano lo stesso k hanno lo stesso hash, hanno anche

la stessa firma.

Descrivere firma e verifica di Elgamal ( denotare con k il valore casuale generato da ogni firma). Due messaggi possono avere stesso hash ma firma diversa, perché l’algoritmo si basa sulla storia dei numeri primi.

2. Average guessing game

A, B and C play the following game. Each of them secretly

chooses an integer in [0, N ]; let such numbers be, respectively, a ,

b and c. Then the average z = ( a + b + c )/3 is computed. The winner

of the game is the player who chose the integer closest to z. The

players use the following protocol.

[A chooses a and nonce ra , then computes xa = ra ( a )]

A → B: xa

[B chooses b e un nonce rb , then computes xb = rb ( b )]

B → C: xa , xb

[C chooses c ]

C → A: xb , c

A → B: ra , c

[now B knows a , b and c ]

B → C: ra , rb

[now C knows a , b and c ]

C → A: rb

[now A knows a , b and c ]

  • Discuss the robustness of the protocol with respect to possible

fraudulent behaviors from A, B and/or C.

  • Modify the protocol for fixing the detected problems.

same game of before

3. Authentication based on public key

  • Describe the original

-Schroeder scheme, its vulnerability and its fixing.

5. Briefly answer the following (at most 8 lines & 1 picture per

question – using more space does not increase the quality)

  • Discuss how to introduce security mechanisms on IP and on TCP.

What differences? What application scenarios?

IPSEC SSL vedi sopra

  • Firewalls: compare stateless packet filtering to session

filtering.

spf controlla pacchetto per pacchetto se ha azione benigna passa

altrimenti no

due pacchetti buoni insieme fanno un azione cattiva, il session

filtering se ne accorge.

1. Diffie-Hellman

With reference to Diffie-Hellman key exchanging scheme, answer:

  • How is the key computed and what are the requirements on

the numbers used for such a computation?

a to b

b to a

gabmodp

  • Try generalizing the DH scheme for exchanging a key among

three subjects.

a b c in cerchio

  • Discuss the robustness of DH wrt active attacks and possible

countermeasures.

Man in the middle, si finge uno dei due

2. Access control models

  • Illustrate the DAC model (from Harrison-Ruzzo-Ullman, or

HRU), define the concept of safety of the protection system and

discuss what practical problems arise within the model.

Matrice soggetti oggetti

  • Why such DAC model is vulnerable to Trojans? What type of

access control model can prevent them from illegally access

private data? Discuss.

“Si perché paso leggere da una aprte e leggere dall’altr”

Posso leggere in A e scrivere in B

Un altro pup leggere solo in b

Il trojan puo leggere da A e scriver in B

3. Message authentications codes (MACs)

Briefly define purposes of data integrity and authentication. Then

answer:

Data integrity implies that data received has not been modified

Authentication: i signed the message.

  • Alice wants to send a file F to Bob, ensuring integrity and

confidentiality; they share a symmetric key KAB and can use AES

(no hashing function is available). Alice sends to Bob:

EncKAB(F). Are integrity and confidentiality guaranteed? Discuss.

Conf and auth but not authentication.

  • Enrich the communication schema for better fulfilling integrity

and confidentiality.

Inviare anche MACKab(F)

4. RSA

  • Describe the encrypting/decrypting scheme of pure RSA.

Describe at least two vulnerabilities of pure RSA. Also discuss how

real implementations of RSA contrast such vulnerabilities.

n=pq

z=(p-1)(q-1)

d|(ed-1)modz=