This document provides an overview of input and output streams in C++. It discusses the history and introduction of streams, the standard input, output, and error streams (cin, cout, cerr, clog), and common I/O functions and keywords in C++ like cout and cin. The benefits of streams are also mentioned, including increased type safety, reduced errors, extensibility, and inheritability compared to C-style I/O functions.
This document discusses abstraction in C++. It defines abstraction as representing crucial features without including unnecessary details. There are two types of abstraction in C++ - data abstraction, which hides data information, and control abstraction, which hides implementation information. Abstract classes provide structure without implementation and allow for dynamic binding. The document presents an example program using an abstraction class and discusses applications like increased reusability and security. It notes that while abstractions are generally good, they can impact performance by slowing code and increasing code size.
This document discusses parallel processing techniques in computer systems, including pipelining and vector processing. It provides information on parallel processing levels and Flynn's classification of computer architectures. Pipelining is described as a technique to decompose sequential processes into overlapping suboperations to improve computational speed. Vector processing involves performing the same operation on multiple data elements simultaneously. The document outlines various pipeline designs and hazards that can occur, such as structural hazards from resource conflicts and data hazards from data dependencies.
This document provides an introduction to graphics programming in C. It discusses setting up graphics using GCC, basic concepts of graphics programming in C, common graphics functions like line(), circle(), rectangle(), and text functions like outtext() and outtextxy(). It also includes a short example program to demonstrate drawing various shapes and text.
The document discusses input and output functions in Python like input() and print(). It explains that the input() function allows taking user input, displays an optional prompt, and returns the input as a string. Examples show how input() works and how eval() can evaluate expressions. The document also covers implicit and explicit type conversions, noting that implicit conversions are automatic while explicit conversions use functions like int(), float(), and str() and may lose data.
Quick sort is a fast sorting algorithm that uses a divide and conquer approach. It works by selecting a pivot element and partitioning the list around the pivot so that all elements less than the pivot come before it and all elements greater than the pivot come after it. The list is then divided into smaller sub-lists and the process continues recursively until the list is fully sorted.
HTML frames allow a webpage to be divided into multiple separate windows called frames. Frames are created using the <frameset> tag, which replaces the <body> tag. The <frameset> tag uses attributes like cols and rows to specify the number and size of vertical or horizontal frames. Individual frames are defined using the <frame> tag within the <frameset>, and can specify attributes like name and src. Links between frames are set using the target attribute to specify which frame the linked content should open in.
The document provides information on various HTML tags used for formatting text and content in a web page. It describes tags for headings, paragraphs, lists, physical styles, phrase formatting, block-level formatting, and text-level formatting. Examples are given showing how to use tags like <h1>, <p>, <ul>, <b>, <pre>, and <font> within HTML code.
The document summarizes how garbage collection works in Java. It describes the marking phase where referenced and unreferenced objects are identified. Unreferenced objects are then deleted in the normal deletion step. For better performance, referenced objects can also be compacted together. The document further explains generational garbage collection, where new objects are allocated to the young generation and aged objects are promoted to the old generation. Minor and major garbage collections handle each generation. Different garbage collectors, like serial, parallel, CMS and G1, are also summarized regarding their implementation and suitability for different applications.
This document provides an introduction to data structures and algorithms. It defines data structures as organized collections of data and describes common types including primitive, non-primitive, linear, and non-linear data structures. It also defines algorithms as step-by-step problem solving processes and discusses characteristics like finite time completion. The document outlines ways to measure algorithm efficiency including time and space complexity and asymptotic notation.
Case study on Intel core i3 processor. Mauryasuraj98
油
The document discusses the Intel Core i3 processor. It provides a history of Intel processors beginning in the 1940s. Key details include that Core i3 processors are multi-core, have integrated graphics, and allow for improved multi-tasking compared to earlier Intel processors. The document outlines features and specifications of Core i3 processors such as clock speed, cache size, and graphics capabilities. It describes applications and advantages such as improved performance but also notes some disadvantages like potential overheating.
The document discusses file handling in C++. It defines a file as a collection of information stored on a computer's disk. There are three main steps to processing a file in C++: opening the file, reading/writing information to the file, and closing the file. It also describes different file stream classes like ifstream for input and ofstream for output that are used to read from and write to files. Functions like seekg() and seekp() allow manipulating the file pointer position.
Main memory is used to store programs and data for the CPU to access directly. Paging is a memory management technique that divides main memory into fixed-sized blocks called frames and divides logical memory into same-sized blocks called pages. The page table maps logical page numbers to physical frame numbers, with translation lookaside buffers caching these mappings to improve performance. Protection bits in page table entries enforce access permissions on individual pages.
The document provides an overview of HTML (Hypertext Markup Language), the standard markup language used to create web pages. It discusses key HTML elements (tags) like <html>, <head>, <body>, <h1>-<h6> for headings, <p> for paragraphs, and <img> for images. It also covers basic HTML page structure, attributes, formatting text, comments, colors, and tables.
The life cycle of an applet involves different states including born, running, idle, and dead as it loads, executes code, becomes inactive, and is removed from memory. An applet transitions between these states, calling methods like init(), start(), stop(), paint(), and destroy() that perform initialization, launching execution, pausing, drawing to the screen, and cleanup. The init() method is called once while start() and stop() can be called multiple times as the applet loads, resumes running, and becomes inactive.
Streams are used to represent different kinds of data flow in C++. There are input streams like ifstream that allow reading from files and output streams like ofstream that allow writing to files. Each file stream has get and put pointers that indicate the current position for reading and writing. Functions like seekg(), tellg(), seekp(), and tellp() can be used to set and retrieve the position of these pointers to allow reading from or writing to arbitrary locations in a file.
The document summarizes chapter 4 on linked lists from a textbook. It covers different types of linked lists including singly linked lists, doubly linked lists, and circular lists. It describes how to implement basic linked list operations like insertion, deletion, and traversal. It also discusses using linked lists to implement stacks, queues, and sparse matrices. Dynamic storage management using linked lists and garbage collection techniques are explained.
This document provides an introduction to object oriented programming in Python. It discusses why OOP is useful, defines some key concepts like classes, objects, methods, and variables. It provides an example of modeling a Taxi using a Taxi class with attributes like driver name and methods like pickUpPassenger. It shows how to define a class, create objects from the class, and call methods on those objects. It also introduces the concept of class variables that are shared among all objects versus instance variables that are unique to each object.
The wrapper classes in Java are used to convert primitive data types like int and float into objects. There are eight wrapper classes that correspond to the eight primitive types. Wrapper classes allow primitive types to be used in contexts that require objects, like collections. They provide methods to convert between primitive types and their corresponding wrapper class objects.
The document discusses various Java I/O streams including input streams, output streams, byte streams, character streams, buffered streams, properties class, print stream, file locking, serialization and print writer class. It provides examples of reading and writing files using FileInputStream, FileOutputStream, FileReader, FileWriter and other stream classes. Methods of different stream classes are also explained along with their usage.
The document outlines the rules and topics that will be covered in a data structures and algorithms course. It includes:
- Class rules prohibiting late entry or early exit from classes and announcing unscheduled quizzes.
- An outline of standard data structures and algorithms to be covered, including arrays, stacks, queues, linked lists, trees, sorting, searching, and graphs.
- An introduction to key concepts like data types, algorithms, performance analysis, and asymptotic notation to analyze time and space complexity.
It is a presentation on some Searching and Sorting Techniques for Computer Science.
It consists of the following techniques:
Sequential Search
Binary Search
Selection Sort
Bubble Sort
Insertion Sort
Templates allow functions and classes to operate on generic types in C++. There are two types of templates: class templates and function templates. Function templates are functions that can operate on generic types, allowing code to be reused for multiple types without rewriting. Template parameters allow types to be passed to templates, similar to how regular parameters pass values. When a class, function or static member is generated from a template, it is called template instantiation.
Modes Of Transfer in Input/Output OrganizationMOHIT AGARWAL
油
This document discusses different modes of data transfer between I/O devices and memory in a computer system. It describes three main modes: programmed I/O, interrupt-initiated I/O, and direct memory access (DMA). Programmed I/O involves constant CPU monitoring during transfers. Interrupt-initiated I/O uses interrupts to notify the CPU when a transfer is ready. DMA allows I/O devices to access memory directly without CPU involvement for improved efficiency.
Pointer is a variable that stores the memory address of another variable. It allows dynamic memory allocation and access of memory locations. There are three ways to pass arguments to functions in C++ - pass by value, pass by reference, and pass by pointer. Pass by value copies the value, pass by reference copies the address, and pass by pointer passes the address of the argument. Pointers can also point to arrays or strings to access elements. Arrays of pointers can store multiple strings. References are alternative names for existing variables and any changes made using the reference affect the original variable. Functions can return pointers or references.
This document provides an overview of pipelining and interrupts in processors. It discusses how pipelining improves processor throughput by overlapping the execution of multiple instructions. An interrupt is described as a signal that causes the processor to suspend its current task and execute an interrupt handler to deal with the event. The document then explains pipelining concepts using an example of an assembly line for laundering clothes. It shows how pipelining reduces the time to complete multiple loads from 6 hours to 3.5 hours. Finally, it briefly discusses fault tolerance in systems using redundancy and different approaches like static and dynamic redundancy.
The document summarizes how garbage collection works in Java. It describes the marking phase where referenced and unreferenced objects are identified. Unreferenced objects are then deleted in the normal deletion step. For better performance, referenced objects can also be compacted together. The document further explains generational garbage collection, where new objects are allocated to the young generation and aged objects are promoted to the old generation. Minor and major garbage collections handle each generation. Different garbage collectors, like serial, parallel, CMS and G1, are also summarized regarding their implementation and suitability for different applications.
This document provides an introduction to data structures and algorithms. It defines data structures as organized collections of data and describes common types including primitive, non-primitive, linear, and non-linear data structures. It also defines algorithms as step-by-step problem solving processes and discusses characteristics like finite time completion. The document outlines ways to measure algorithm efficiency including time and space complexity and asymptotic notation.
Case study on Intel core i3 processor. Mauryasuraj98
油
The document discusses the Intel Core i3 processor. It provides a history of Intel processors beginning in the 1940s. Key details include that Core i3 processors are multi-core, have integrated graphics, and allow for improved multi-tasking compared to earlier Intel processors. The document outlines features and specifications of Core i3 processors such as clock speed, cache size, and graphics capabilities. It describes applications and advantages such as improved performance but also notes some disadvantages like potential overheating.
The document discusses file handling in C++. It defines a file as a collection of information stored on a computer's disk. There are three main steps to processing a file in C++: opening the file, reading/writing information to the file, and closing the file. It also describes different file stream classes like ifstream for input and ofstream for output that are used to read from and write to files. Functions like seekg() and seekp() allow manipulating the file pointer position.
Main memory is used to store programs and data for the CPU to access directly. Paging is a memory management technique that divides main memory into fixed-sized blocks called frames and divides logical memory into same-sized blocks called pages. The page table maps logical page numbers to physical frame numbers, with translation lookaside buffers caching these mappings to improve performance. Protection bits in page table entries enforce access permissions on individual pages.
The document provides an overview of HTML (Hypertext Markup Language), the standard markup language used to create web pages. It discusses key HTML elements (tags) like <html>, <head>, <body>, <h1>-<h6> for headings, <p> for paragraphs, and <img> for images. It also covers basic HTML page structure, attributes, formatting text, comments, colors, and tables.
The life cycle of an applet involves different states including born, running, idle, and dead as it loads, executes code, becomes inactive, and is removed from memory. An applet transitions between these states, calling methods like init(), start(), stop(), paint(), and destroy() that perform initialization, launching execution, pausing, drawing to the screen, and cleanup. The init() method is called once while start() and stop() can be called multiple times as the applet loads, resumes running, and becomes inactive.
Streams are used to represent different kinds of data flow in C++. There are input streams like ifstream that allow reading from files and output streams like ofstream that allow writing to files. Each file stream has get and put pointers that indicate the current position for reading and writing. Functions like seekg(), tellg(), seekp(), and tellp() can be used to set and retrieve the position of these pointers to allow reading from or writing to arbitrary locations in a file.
The document summarizes chapter 4 on linked lists from a textbook. It covers different types of linked lists including singly linked lists, doubly linked lists, and circular lists. It describes how to implement basic linked list operations like insertion, deletion, and traversal. It also discusses using linked lists to implement stacks, queues, and sparse matrices. Dynamic storage management using linked lists and garbage collection techniques are explained.
This document provides an introduction to object oriented programming in Python. It discusses why OOP is useful, defines some key concepts like classes, objects, methods, and variables. It provides an example of modeling a Taxi using a Taxi class with attributes like driver name and methods like pickUpPassenger. It shows how to define a class, create objects from the class, and call methods on those objects. It also introduces the concept of class variables that are shared among all objects versus instance variables that are unique to each object.
The wrapper classes in Java are used to convert primitive data types like int and float into objects. There are eight wrapper classes that correspond to the eight primitive types. Wrapper classes allow primitive types to be used in contexts that require objects, like collections. They provide methods to convert between primitive types and their corresponding wrapper class objects.
The document discusses various Java I/O streams including input streams, output streams, byte streams, character streams, buffered streams, properties class, print stream, file locking, serialization and print writer class. It provides examples of reading and writing files using FileInputStream, FileOutputStream, FileReader, FileWriter and other stream classes. Methods of different stream classes are also explained along with their usage.
The document outlines the rules and topics that will be covered in a data structures and algorithms course. It includes:
- Class rules prohibiting late entry or early exit from classes and announcing unscheduled quizzes.
- An outline of standard data structures and algorithms to be covered, including arrays, stacks, queues, linked lists, trees, sorting, searching, and graphs.
- An introduction to key concepts like data types, algorithms, performance analysis, and asymptotic notation to analyze time and space complexity.
It is a presentation on some Searching and Sorting Techniques for Computer Science.
It consists of the following techniques:
Sequential Search
Binary Search
Selection Sort
Bubble Sort
Insertion Sort
Templates allow functions and classes to operate on generic types in C++. There are two types of templates: class templates and function templates. Function templates are functions that can operate on generic types, allowing code to be reused for multiple types without rewriting. Template parameters allow types to be passed to templates, similar to how regular parameters pass values. When a class, function or static member is generated from a template, it is called template instantiation.
Modes Of Transfer in Input/Output OrganizationMOHIT AGARWAL
油
This document discusses different modes of data transfer between I/O devices and memory in a computer system. It describes three main modes: programmed I/O, interrupt-initiated I/O, and direct memory access (DMA). Programmed I/O involves constant CPU monitoring during transfers. Interrupt-initiated I/O uses interrupts to notify the CPU when a transfer is ready. DMA allows I/O devices to access memory directly without CPU involvement for improved efficiency.
Pointer is a variable that stores the memory address of another variable. It allows dynamic memory allocation and access of memory locations. There are three ways to pass arguments to functions in C++ - pass by value, pass by reference, and pass by pointer. Pass by value copies the value, pass by reference copies the address, and pass by pointer passes the address of the argument. Pointers can also point to arrays or strings to access elements. Arrays of pointers can store multiple strings. References are alternative names for existing variables and any changes made using the reference affect the original variable. Functions can return pointers or references.
This document provides an overview of pipelining and interrupts in processors. It discusses how pipelining improves processor throughput by overlapping the execution of multiple instructions. An interrupt is described as a signal that causes the processor to suspend its current task and execute an interrupt handler to deal with the event. The document then explains pipelining concepts using an example of an assembly line for laundering clothes. It shows how pipelining reduces the time to complete multiple loads from 6 hours to 3.5 hours. Finally, it briefly discusses fault tolerance in systems using redundancy and different approaches like static and dynamic redundancy.
Liferay SSL/TLS Security. Come configurare il bundle Liferay per abilitare il...Antonio Musarra
油
In questo eBook sar affrontato un argomento legato alla sicurezza che riguarda il come rendere sicure le connessioni HTTP attraverso il protocollo SSL/TLS (da ora in avanti TLS). Questo aspetto di sicurezza non 竪 strettamente legato a Liferay, infatti non esiste nessun riferimento sulla LDN, riguarda invece linfrastruttura dove il portale Liferay 竪 collocato.
Il percorso che seguiremo nel corso di questo eBook per raggiungere il nostro obiettivo, sar cos狸 organizzato:
1. Gestione dei certificati
2. Configurazione del protocollo TLS
3. Configurazione del portale Liferay (sia Apache Tomcat sia WildFly)
Gli HTTP Security Header e altri elementi da sapere su HTTP in un Web Applica...Simone Onofri
油
Negli ultimi anni la disponibilit di Browser sempre pi湛 avanzati e le grandi capacit di calcolo dei Client hanno portato allattenzione della comunit di sicurezza una serie di attacchi o tecniche che hanno come bersaglio principale lutente dellapplicazione. I vendor e organizzazioni come IEFT e W3C hanno considerato opportuna limplementazione di alcune protezioni attivabili tramite Header HTTP.
Gli header devono essere configurati per non rilasciare le informazioni, ottimizzare cache e codifica. Di contro manipolando direttamente i pacchetti HTTP 竪 possibile alterare anche le risposte dellapplicazione o il suo funzionamento. Durate il talk analizzeremo attacchi come lUI Redressing / HTTP Response Splitting, HTTP Verb Tampering e molto altro.
Porte aperte nelle app android scoperta diagnosi e valutazione di sicurezza ...Massimiliano Cristarella
油
Summary of Understanding Open Ports in Android Applications: Discovery, Diagnosis, and Security Assessment.
Source paper: https://www.ndss-symposium.org/ndss-paper/understanding-open-ports-in-android-applications-discovery-diagnosis-and-security-assessment/
Cyber Attack: stories from the field - Threat analysis: useful methodologies ...Francesco Faenzi
油
Le infrastrutture critiche e le istituzioni devono far fronte a minacce cyber sempre crescenti che potrebbero compromettere la sopravvivenza e la prosperit dellorganizzazione stessa. Essere resilienti oggi significa essere in grado di anticipare gli eventi, di essere preparati ad affrontarli e di adattarsi ad uno scenario dinamico in continua evoluzione. Le capacit di resilienza che aziende e manager sapranno mettere in campo influenzeranno sempre pi湛 la competitivit dellorganizzazione stessa.
In tale contesto, la Fondazione GCSEC, da sempre impegnata a creare le condizioni per migliorare le competenze e la cooperazione in materia di sicurezza, organizza il workshop "Attacco Cyber - Esperienze operative per la resilienza del business", che si terr il 15 Giugno 2016 a Roma presso lHotel Bernini Bristol - piazza Barberini, 23.
Il workshop si propone di percorrere le fasi principali della gestione di una crisi derivante da un attacco cyber, con lobiettivo di migliorare le capacit, le competenze e la cooperazione in materia di sicurezza informatica fra i diversi attori coinvolti. L'evento sar un momento concreto per la condivisione di informazioni tra le grandi aziende pubblico-private nazionali e le infrastrutture critiche per esplorare il tema della gestione degli incidenti. Saranno discusse, attraverso lesperienza personale dei relatori, le principali attivit da mettere in piedi durante la gestione di attacchi informatici. Saranno inoltre condivise le esperienze di rappresentanti di SOC, team di threat analysis, unit di business continuity e gestione crisi, comprendendo anche gli aspetti legali e assicurativi.
Il workshop si inserisce in un percorso di collaborazione con Lutech volto a rafforzare la consapevolezza a livello italiano in materia di gestione incidenti cyber.
L'evento, la cui partecipazione 竪 su invito, vedr un pubblico qualificato e selezionato comprendente le istituzioni nazionali civili e militari, le industrie strategiche e le infrastrutture critiche nazionali.
Cos竪 la sicurezza informatica
Cenni di crittografia
Sicurezza nel web:
Autenticazione e Autorizzazione
Esempi di autenticazione (form login, token base etc etc)
Esempi di attacchi a siti web: come difendersi?
Network+ Guide to Networks 7th Edition West Test Bank download pdfsofealames87
油
Network+ Guide to Networks 7th Edition West Test Bank available for instant download right after payment at https://testbankdeal.com/product/network-guide-to-networks-7th-edition-west-test-bank. Explore additional solution manuals and test banks in https://testbankdeal.com/ Download full chapter PDF.
Il talk si propone di fornire strumenti utili ai developer che vogliono offrire ai propri utenti autenticazione ed autorizzazione da differenti canali quali mobile e browser su differenti tipi di risorse come web-application e REST services. Saranno mostrati gli algoritmi di crittografia ed i protocolli pi湛 noti di autenticazione/autorizzazione, evitando noie matematiche e considerando solo le applicazioni pratiche.
Gli argomenti trattati saranno
Crittografia (25 minuti)
symmetric key, asymmetric key, key exchange, key derivation function, key management, hash function, MAC function
Autenticazione e Autorizzazione (50 minuti)
HTTPS, Password, autenticazione a 2 fattori, Cookie (stateful), Access Token (stateless), JWT,OAuth2 e OpenID Connect
1. IPsec Cos'竪 ? IPsec [2] (IP Security) 竪 una suite di protocolli utilizzati per creare reti private virtuali [1] (VPN). Universit dell'Insubria - Relazione di Sicurezza Definizione IETF (Internet Engineering Task Force): Protocollo di sicurezza a livello rete sviluppato per fornire servizi di sicurezza crittografica che fornisce un supporto flessibile per autenticazione, integrit e confidenzialit. IPsec sta diventando lo standard di fatto per la creazione di VPN.
2. Tipi di VPN LAN-to-LAN VPN: La connessione di due reti private per formare una sola rete privata virtuale. Client-to-LAN VPN: Lestensione di una rete privata per consentire laccesso remoto agli utenti che diventano parte della rete privata. Universit dell'Insubria - Relazione di Sicurezza
5. Protocolli di IPsec Universit dell'Insubria - Relazione di Sicurezza IKE: Internet Key Exchange[2] Fornisce un framework per la negoziazione dei parametri di sicurezza e lo scambio delle chiavi. ESP: Encapsulating Security Payload[4] fornisce un framework per la sicurezza dei dati e opzionalmente l'autenticazione. AH: Autentication Header[3] fornisce un framework per lautenticazione e la sicurezza dei dati.
6. IKE Universit dell'Insubria - Relazione di Sicurezza una combinazione di 3 diversi protocolli: SKEME: Fornisce un meccanismo per lutilizzo di crittografia a chiave pubblica per scopi di autenticazione. Oakley: Protocollo per lo scambio delle chiavi basato su Diffie-Hellman. ISAKMP[2]: Definisce larchitettura di scambio di messaggi, inclusi i formati dei pacchetti e le varie transizioni tra nodi IPsec.
7. ISAKMP Universit dell'Insubria - Relazione di Sicurezza un protocollo che definisce: Le procedure necessarie per attivare, negoziare, modificare e cancellare le Security Association[1] (SA). I formati dei pacchetti per lo scambio dei dati di generazione e autenticazione delle chiavi.
8. Procedure Universit dell'Insubria - Relazione di Sicurezza Un tunnel IPsec viene costruito attraverso le seguenti fasi: Un nodo IPsec inizializza il collegamento con il nodo remoto o con la rete remota. I due nodi creano una Security Association (SA), ovvero un canale sicuro da utilizzare per i messaggi. I due nodi utilizzano la SA appena creata per negoziare le Security Association (SA) per altri protocolli. I dati iniziano a passare attraverso il tunnel criptato utilizzando le tecniche di incapsulamento AH o ESP.
9. Formati Universit dell'Insubria - Relazione di Sicurezza Lintestazione di un messaggio ISAKMP ha la seguente struttura: Un messaggio ISAKMP 竪 costituito da unintestazione seguita da uno o pi湛 payload. Tutto ci嘆 viene trasportato con il protocollo UDP.
10. Tipi di negoziazione IKE Universit dell'Insubria - Relazione di Sicurezza IKE pu嘆 realizzare diversi tipi di negoziazione:
11. Main Mode Universit dell'Insubria - Relazione di Sicurezza La modalit Main Mode[1] avviene tramite lo scambio di 6 messaggi tra i due nodi IPsec.
12. Messaggio 1 (initiator -> responder) Universit dell'Insubria - Relazione di Sicurezza SA Payload: Transform Payload: Proposal Payload:
13. Messaggio 2 (responder -> initiator) Universit dell'Insubria - Relazione di Sicurezza SA Payload: identico al precedente. Proposal Payload: Contiene le informazioni che il Responder ha deciso di accettare. Transform Payload: Contiene le informazioni che il Responder ha deciso di accettare.
14. Messaggio 3 (initiator -> responder) Universit dell'Insubria - Relazione di Sicurezza Key Exchange Payload : Nonce Payload: Contiene il valore pubblico di Diffie-Hellman:
15. Messaggio 4 (responder -> initiator) Universit dell'Insubria - Relazione di Sicurezza KE Payload: Contiene il valore pubblico di Diffie-Hellman: Nonce Payload: Contiene il nonce del responder N r
16. Calcolo delle chiavi Universit dell'Insubria - Relazione di Sicurezza A questo punto entrambi i nodi sono in grado di calcolare il segreto condiviso: initiator: responder: A partire dal segreto condiviso S initiator e responder calcolano 3 chiavi: SKEYID: SKEYID_d: SKEYID_a: SKEYID_e:
17. Messaggio 5 (initiator -> responder) Universit dell'Insubria - Relazione di Sicurezza Identification Payload : Hash Payload : Contiene un valore di hash calcolato nel seguente modo:
18. Messaggio 6 (responder -> initiator) Universit dell'Insubria - Relazione di Sicurezza Identification Payload: Contiene ID-R. Hash Payload: Contiene un valore di hash calcolato nel seguente modo:
19. Autenticazione con PSK Universit dell'Insubria - Relazione di Sicurezza Se i due valori di hash calcolati da Initiator e Responder sono gli stessi allora la sessione viene autenticata e quindi 竪 stata creata la SA. Initiator: Responder: Decifra il messaggio 6 utilizzando SKEYID_e Trova la PK-R (Preshared-Key del responder) utilizzando ID-R Calcola HASH_R Se HASH_R ricevuto = HASH_R calcolato lautenticazione ha successo Decifra il messaggio 5 utilizzando SKEYID_e Trova la PK-I (Preshared-Key del initiator) utilizzando ID-I Calcola HASH_I Se HASH_I ricevuto = HASH_I calcolato lautenticazione ha successo
20. Aggressive Mode Universit dell'Insubria - Relazione di Sicurezza Nellaggressive mode[1] si ottiene lo stesso risultato che con il main mode, ma in soli 3 scambi di messaggi.
21. Quick Mode Universit dell'Insubria - Relazione di Sicurezza Come la modalit Main mode 竪 usata per concordare i parametri dellISAKMP SA, la modalit quick mode[1] 竪 usata per concordare i parametri della IPsec SA. Nel nostro esempio, supponiamo che liniziatore ha deciso di utilizzare una propriet conosciuta come Perfect Forward Secrecy (PFS).
22. Messaggio 1 (initiator -> responder) Universit dell'Insubria - Relazione di Sicurezza Hash Payload : Valore di hash calcolato a partire dal segreto S e dal Nonce N i . SA Payload : Identico a quello del main mode. Proposal Payload : Contiene il tipo di incapsulamento e lSPI. Transform Payload : Contiene la modalit tunnel o transport, lalgoritmo di crittografia, lalgoritmo di hash e il metodo di autenticazione. KE Payload : Contiene il valore Nonce Payload : Contiene il nonce dellinitiator N i ID-S Payload : ID-source in genere 竪 lindirizzo IP dellinitiator. ID-D Payload : ID-destination in genere 竪 lindirizzo IP del responder.
23. Messaggio 2 (responder -> initiator) Hash Payload : Valore di hash calcolato a partire dal segreto S e dal Nonce N r . SA Payload : Identico a quello del main mode. Proposal Payload : Contiene il tipo di incapsulamento e lSPI nella direzione opposta. Transform Payload : Contiene la modalit tunnell o transport, lalgoritmo di crittografia, lalgoritmo di hash e il metodo di autenticazione scelti dal responder. KE Payload : Contiene il valore Nonce Payload : Contiene il nonce dellresponder N r ID-S Payload : ID-source in genere 竪 lindirizzo IP dellinitiator. ID-D Payload : ID-destination in genere 竪 lindirizzo IP del responder.
24. Calcolo delle chiavi Universit dell'Insubria - Relazione di Sicurezza A questo punto entrambi i nodi sono in grado di calcolare il segreto condiviso: initiator: responder: A partire dal segreto condiviso S initiator e responder calcolano la chiave per la IPsec SA: Initiator: Responder:
25. Messaggio 3 (initiator -> responder) Universit dell'Insubria - Relazione di Sicurezza Hash Payload : Lultimo messaggio viene inviato per verificare la Liveness del responder. Esso contiene semplicemente un Hash calcolato nel seguente modo: Questo messaggio serve al responder per sapere se il messaggio 2 竪 arrivato allinitiator. Dopo che il responder ha ricevuto il messaggio 3 la negoziazione della SA 竪 terminata e la SA pu嘆 essere utilizzata per lo scambio dei dati sicuri.
26. Autenticazione con Digital Signature Universit dell'Insubria - Relazione di Sicurezza Lunica differenza tra lautenticazione con Preshared Key e Digital Signature 竪 nei passaggi 5 e 6 del main mode. La prima differenza importante riguarda il modo in cui le SKEYs vengono generate:
27. Messaggio 5 (Digital Signature) Universit dell'Insubria - Relazione di Sicurezza ID Payload : Contiene un identificativo per linitiator come lindirizzo IP o il nome dellhost. Signature Payload : Contiene la signature dellinitiator calcolata nel seguente modo:
28. Messaggio 6 (Digital Signature) Universit dell'Insubria - Relazione di Sicurezza ID Payload : Contiene un identificativo per il responder come lindirizzo IP o il nome dellhost. Signature Payload : Contiene la signature del responder calcolata nel seguente modo:
29. Autenticazione con Digital Signature Universit dell'Insubria - Relazione di Sicurezza Se i due valori di hash calcolati da Initiator e Responder sono gli stessi allora la sessione viene autenticata e quindi 竪 stata creata la SA. Initiator: Responder: Decifra il messaggio 6 utilizzando SKEYID_e Decifra HASH_R usando PK_R Calcola HASH_R Se HASH_R ricevuto = HASH_R calcolato lautenticazione ha successo Decifra il messaggio 5 utilizzando SKEYID_e Decifra HASH_I usando PK_I Calcola HASH_I Se HASH_I ricevuto = HASH_I calcolato lautenticazione ha successo
30. Sicurezza IKE (1) Clogging Attack: Lattacco clogging [1] 竪 un attacco di tipo DoS in cui lattaccante crea un indirizzo sorgente di un utente legittimo e invia una chiave pubblica Diffie-Hellman allaltro utente forzandolo ad eseguire un esponenziale modulare per calcolare la chiave segreta. Una serie ripetuta di messaggi di questo tipo pu嘆 mettere in ginocchio il sistema della vittima. Il cookie evita questo attacco, ma deve seguire le specifiche ISAKMP: Deve dipendere dalle specifiche parti. Questo impedisce a un estraneo di derivare un cookie da un indirizzo IP e una porta UDP. Non deve essere possibile per nessuno, tranne per lentit emettitrice, generare dei cookie che vengano accettati da tale entit. I metodi di generazione e verifica di un cookie devono essere veloci per evitare attacchi che mirano a consumare le risorse di elaborazione. Un attaccante non potr pi湛 eseguire un attacco di tipo clogging perch辿 quando invier allaltro utente una chiave pubblica di Diffie-Hellman, laltro utente prima verificher il cookie e poi inizier la computazione, ma essendo il cookie un numero pseudo-casuale lattaccante non 竪 in grado di crearne uno falso da solo.
31. Sicurezza IKE (2) Universit dell'Insubria - Relazione di Sicurezza Replay Attack: In un attacco a replay [2], un estraneo ottiene copia di un pacchetto e successivamente lo ritrasmette alla destinazione prevista. Questo pu嘆 causare problemi al funzionamento del servizio. Il Nonce ha lo scopo di sventare questo genere di attacchi.
32. Sicurezza IKE (3) Man-in-the-middle Attack: L'algoritmo Diffie-Hellman 竪 soggetto all'attacco man in the middle [2]: Nello scambio di chiavi con IKE questo attacco non pu嘆 funzionare perch辿 i 2 nodi devono autenticarsi: Nel caso di autenticazione con Preshared Key il nodo E dovrebbe conoscere la Preshared Key. Nel caso di autenticazione con Digital Signature il nodo E dovrebbe conoscere la chiave segreta per la Firma di A e di B.
33. Openswan Universit dell'Insubria - Relazione di Sicurezza OpenSwan[6] 竪 limplementazione IPsec pi湛 diffusa sui Linux recenti. Deriva da FreeSwan, progetto non pi湛 mantenuto. Il progetto 竪 composto da 2 componenti: KLIPS : Il modulo del kernel per il supporto IPsec. PLUTO : Demone che implementa il protocollo IKE.
34. File di Configurazione di Openswan Universit dell'Insubria - Relazione di Sicurezza Openswan utilizza principalmente 2 file di configurazione per configurare una connessione IPsec: /etc/ipsec.secrets : Contiene le chiavi RSA pubbliche e private oppure la PSK. /etc/ipsec.conf : Contiene i setting, le opzioni e le connessioni per openswan.
35. Il file /etc/ipsec.conf Universit dell'Insubria - Relazione di Sicurezza Il file 竪 suddiviso in 3 sezioni: config setup : Parametri e opzioni globali. conn %default : Opzionale, 竪 una sezione di default che contiene parametri globali che vengono ereditati dalle conn successive. conn nome-connesione : Definizione di una particolare connessione.
36. Il file /etc/ipsec.secrets Universit dell'Insubria - Relazione di Sicurezza Questo file contiene le chiavi RSA pubbliche e private oppure la PSK dellhost. Il file pu嘆 essere generato automaticamente lanciando il comando: >ipsec newhostkey output /etc/ipsec.secrets
39. Avvio di Openswan Per avviare openswan lanciamo il comando: Se tutto funziona correttamente apparira un log simile al seguente: Sep 15 20:05 A pluto[20362]: " A-B " #365: initiating Main Mode Sep 15 20:05 A pluto[20362]: " A-B " #365: transition from state STATE_MAIN_I1 to state STATE_MAIN_I2 Sep 15 20:05 A pluto[20362]: " A-B " #365: I did not send a certificate because I do not have one. Sep 15 20:05 A pluto[20362]: " A-B " #365: transition from state STATE_MAIN_I2 to state STATE_MAIN_I3 Sep 15 20:05 A pluto[20362]: " A-B " #365: Peer ID is ID_IPV4_ADDR: ' 192.168.0.1 ' Sep 15 20:05 A pluto[20362]: " A-B " #365: transition from state STATE_MAIN_I3 to state STATE_MAIN_I4 Sep 15 20:05 A pluto[20362]: " A-B " #365: ISAKMP SA established Sep 15 20:05 A pluto[20362]: " A-B " #366: initiating Quick Mode RSASIG+ENCRYPT+TUNNEL+PFS+UP {using isakmp#365} Sep 15 20:05 A pluto[20362]: " A-B " #366: transition from state STATE_QUICK_I1 to state STATE_QUICK_I2 Sep 15 20:05 A pluto[20362]: " A-B " #366: sent QI2, IPsec SA established {ESP=>0xe5f72aaa <0xc51033f4} > /etc/init.d/ipsec {start | stop | restart }
40. host-to-host tunnel (PSK) Universit dell'Insubria - Relazione di Sicurezza A volte c竪 bisogno di connettere Openswan a un dispositivo che non pu嘆 gestire chiavi RSA. Immaginiamo che A sia questo host. In questo caso dobbiamo modificare il file /etc/ipsec.secrets nel seguente modo: 192.168.0.1 192.168.0.2 : PSK segreto Inoltre dobbiamo modificare la connessione nel file /etc/ipsec.conf nel seguente modo: conn A-B authby=secret left=192.168.0.1 right=192.168.0.2 type=tunnel auto=start
43. Roadwarriors tunnel (PSK) Universit dell'Insubria - Relazione di Sicurezza In questo caso dobbiamo modificare il file /etc/ipsec.secrets nel seguente modo su A: 192.168.0.1 %any : PSK password Inoltre dobbiamo modificare il file /etc/ipsec.secrets nel seguente modo su B: %defaultroute 87.9.19.54 : PSK password
44. Altre opzioni di Openswan Universit dell'Insubria - Relazione di Sicurezza L'opzione IKE : 竪 usata per impostare i parametri di negoziazione della ISAKMP SA come ad esempio: L'opzione ESP : 竪 usata per impostare i parametri di negoziazione della IPsec SA come ad esempio: ike=3des-sha1-96,aes-md5-96 esp=aes256-sha1,aes128-sha1,3des-sha1 L'opzione aggrmode : imposta l'aggressive mode nella negoziazione della ISAKMP SA: aggrmode=yes
45. Certificati x.509 e openswan Universit dell'Insubria - Relazione di Sicurezza Finora abbiamo visto come creare una connessione IPsec per uno specifico utente, ma questo 竪 sicuramente poco scalabile. In questa parte vogliamo creare un server VPN che sia in grado di distribuire differenti credenziali VPN ad ogni singolo utente. Il modo pi湛 usato per fare questo 竪 attraverso i certificati X.509. x.509 竪 uno standard definito dalla ITU-T (International Telecommunication Union - Telecommunication Standardization Sector). I certificati vengono rilasciati da una Autorit di Certificazione (CA) la cui firma apposta sul certificato garantisce il legame tra chiave ed entit.
46. Struttura x.509 Universit dell'Insubria - Relazione di Sicurezza La struttura delle CA 竪 di tipo gerarchico: RDNs: Michele Rossi DN(Distinguished Name): C=CA / State=Italy / Locality=Milan / Organization=Microsoft / OU=Sales Staff / UserID=Michele Rossi
47. Struttura di un certificato x.509 Universit dell'Insubria - Relazione di Sicurezza Certificate: Version: 3 (0x2) Serial Number: e4...48 Sign Algorithm:sha1WithRSAEnc Issuer: C=CA, ST=Italy, L=Milan, O=Microsoft, OU=Support Staff, CN=Microsoft Root Validity Not Before: Feb 19 Not After : Mar 21 Subject: C=CA, ST=Italy, L=Milan, O=Microsoft, OU=Sales Staff, CN=Michele Rossi Subject Public Key Info: Public Key Algorithm:RSA RSA Public Key: Modulus:00...db Exponent: 65...77 X509v3 extensions: ... Signature Algorithm:sha1WithRSA 2b...5e
48. x.509 e Openswan Universit dell'Insubria - Relazione di Sicurezza Quando la connessione 竪 configurata per lutilizzo di certificati x.509, invece di caricare la chiave privata RSA da /etc/ipsec.secrets, la chiave privata viene caricata dal un file .key e la chiave pubblica viene caricata da un file .cert. Questi file vengono caricati automaticamente se vengono inseriti nelle directory corrette: /etc/ipsec.d/certs : contiene i certificati con le chiavi pubbliche. /etc/ipsec.d/cacerts : contiene i CA certificates. /etc/ipsec.d/private : contiene le chiavi private.
51. Conclusioni Universit dell'Insubria - Relazione di Sicurezza Sicurezza : IPsec porta un indubbio vantaggio in termini di sicurezza, trasferendo al network layer i problemi di autenticazione e confidenzialit prima risolti con soluzioni tipicamente ad application layer (ad es. ssh, kerberos, ssl). Complessit : l'infrastruttura IPsec 竪 quanto meno complessa sia in termini di protocollo sia per quanto riguarda l'utilizzo di applicativi (come Openswan) o di dispositivi (come i Router ad es: Cisco) che la implementano. Uso limitato : pur essendo stato definito ormai alcuni anni fa IPsec 竪 utilizzato al momento in casi abbastanza limitati.
52. Bibliografia Universit dell'Insubria - Relazione di Sicurezza Saadat Malik, Network Security Principles and Practices, Cisco Press, Chap. 13, February 2002. S. Kent, R. Atkinson, Security Architecture for the Internet Protocol, RFC 2401, November 1998 S. Kent, R. Atkinson, IP Encapsulating Security Payload (ESP), RFC 2406, November 1998 S. Kent, R. Atkinson, IP Authentication Header, RFC 2402, November 1998 D. Piper, The Internet IP Security Domain of Interpretation for ISAKMP, RFC 2407, November 1998. Wouters P. & Bantolf K. (2006) Building and integrating Virtual Private Networks with Openswan, Packt Publishing Ltd