PB173 - Tématický vývoj aplikací v C/C++ Domain specific development in C/C++ Skupina: Aplikovaná kryptografie a bezpečné programování Petr Švenda

Slides:



Advertisements
Similar presentations
Lecture 5: Cryptographic Hashes
Advertisements

CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
Module 5: TLS and SSL 1. Overview Transport Layer Security Overview Secure Socket Layer Overview SSL Termination SSL in the Hosted Environment Load Balanced.
1 MD5 Cracking One way hash. Used in online passwords and file verification.
Exploring timing based side channel attacks against i CCMP Suman Jana, Sneha K. Kasera University of Utah Introduction
Apr 30, 2002Mårten Trolin1 Previous lecture – passwords Passwords for authentication –Storing hashed passwords –Use of salt Passwords for key generation.
1 CS 577 “TinySec: A Link Layer Security Architecture for Wireless Sensor Networks” Chris Karlof, Naveen Sastry, David Wagner UC Berkeley Summary presented.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Feb 19, 2002Mårten Trolin1 Previous lecture Practical things about the course. Example of cryptosystem — substitution cipher. Symmetric vs. asymmetric.
.Net Security and Performance -has security slowed down the application By Krishnan Ganesh Madras.
Lecture 19 Page 1 CS 111 Online Symmetric Cryptosystems C = E(K,P) P = D(K,C) E() and D() are not necessarily the same operations.
Lecture 23 Internet Authentication Applications modified from slides of Lawrie Brown.
Sagar Joshi Senior Security Consultant | ACE Team, Microsoft Information Security
DRM Building Blocks - Protecting and Tracking Content Adopted from Chapter 5, Digital Rights Management Business and Technology.
每时每刻 可信安全 1The DES algorithm is an example of what type of cryptography? A Secret Key B Two-key C Asymmetric Key D Public Key A.
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 22 – Internet Authentication.
Feb 17, 2003Mårten Trolin1 Previous lecture Practical things about the course. Example of cryptosystem — substitution cipher. Symmetric vs. asymmetric.
TinySec: A Link Layer Security Architecture for Wireless Sensor Networks Chris Karlof :: Naveen Sastry :: David Wagner Presented by Roh, Yohan October.
Public / Private Keys was a big year… DES: Adopted as an encryption standard by the US government. It was an open standard. The NSA calls it “One.
Cryptography and Network Security Chapter 14 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
Project: Simulated Encrypted File System (SEFS) Omar Chowdhury Fall 2015CS526: Information Security1.
Lecture 3 Page 1 CS 236 Online Introduction to Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
PROJECT DOMAIN : NETWORK SECURITY Project Members : M.Ananda Vadivelan & E.Kalaivanan Department of Computer Science.
Advanced Block Cipher Characteristic. Introduction Published by NIST in 2001 Developed to overcome bottleneck of 3DES Block length is of 128 bits Key.
PB173 - Tématický vývoj aplikací v C/C++ (Jaro 2016) Skupina: Aplikovaná kryptografie a bezpečné programováníAplikovaná kryptografie a bezpečné programování.
PB173 - Tématický vývoj aplikací v C/C++ (jaro 2016)
PB173 - Tématický vývoj aplikací v C/C++ (jaro 2016)
Web Applications Security Cryptography 1
Hardware-rooted Trust for Secure Key Management & Transient Trust
PV204 Security technologies LABS
RSA Laboratories’ PKCS Series - a Tutorial
Cryptography Why Cryptography Symmetric Encryption
Cryptography and Network Security
Secure Sockets Layer (SSL)
School of Computer Science and Engineering Pusan National University
Hybrid Cloud Architecture for Software-as-a-Service Provider to Achieve Higher Privacy and Decrease Securiity Concerns about Cloud Computing P. Reinhold.
e-Health Platform End 2 End encryption
Public Key Encryption and Digital Signatures
Radius, LDAP, Radius used in Authenticating Users
Security.
COMP3220 Web Infrastructure COMP6218 Web Architecture
November 2017 Project: IEEE P Working Group for Wireless Personal Area Networks (WPANs) Submission Title: [AES-256 for ] Date Submitted:
Basic Network Encryption
PHP / MySQL Introduction
Originally by Yu Yang and Lilly Wang Modified by T. A. Yang
Chapter 3: Windows7 Part 4.
Using SSL – Secure Socket Layer
Dynamic DNS support for EGI Federated cloud
Security.
Architectures of distributed systems Fundamental Models
The Secure Sockets Layer (SSL) Protocol
Architecture Competency Group
Lecture Topics: 11/1 General Operating System Concepts Processes
Analysis models and design models
Protocol ap1.0: Alice says “I am Alice”
Architectures of distributed systems Fundamental Models
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
Public Key Infrastructure
Chapter 2: Operating-System Structures
Outline Using cryptography in networks IPSec SSL and TLS.
ONLINE SECURE DATA SERVICE
Public-Key, Digital Signatures, Management, Security
Basic Network Encryption
Architectures of distributed systems Fundamental Models
CPU Structure CPU must:
Chapter 2: Operating-System Structures
Chapter 8 roadmap 8.1 What is network security?
Review of Cryptography: Symmetric and Asymmetric Crypto Advanced Network Security Peter Reiher August, 2014.
Presentation transcript:

PB173 - Tématický vývoj aplikací v C/C++ Domain specific development in C/C++ Skupina: Aplikovaná kryptografie a bezpečné programování Petr Švenda Konzultace: A406, Pondělí 15:00-15:40

| PB173 - Group: Applied cryptography Portability and memory restrictions 2

| PB173 - Group: Applied cryptography Memory restrictions Size of the code vs. runtime memory requirements Depends on the target platform –usually of little concern (RAM is big enough) –sometimes critical factor for algorithms selection embedded devices, e.g., sensor nodes Algorithms usually provides possibility for optimization –precomputed tables – speed vs. memory –key schedule vs. on-the-fly key schedule –optimizations may increase risk for side channel attacks Write correct code first, then optimize –especially true in security 3

| PB173 - Group: Applied cryptography Portability – different operating systems Usually no problems with algorithms –plain C code Problems with additional functionality –read file, directory listing, user input, GUI –often cannot be solved by standardized functions or POSIX –abstract and separate platform-dependent functions move them into distinct modules easy to replace/extend for target platform later Data generated by your application should be portable –ASN.1 encoding –TLV encoding –binary vs. text formats –Base64 encoding 4

| PB173 - Group: Applied cryptography Portability – different hardware platforms Little vs. big endian architecture –usually problem with bit-based operations –e.g., bit rotation –problem with interpretation of binary formats Highly optimized implementations –e.g., Brian Gladman’s AES –may use architecture specific operations and behaviour –multiple byte operations in single tick –special representation of memory data –may use macros heavily 5

| PB173 - Group: Applied cryptography Reference vs. optimized version Double meaning of “reference” word –reference implementation from algorithm designers (Rijndael) –reference == code you should use Reference implementation (e.g., Rijndael) –usually simple and understandable API –lower performance –may not protect against implementation attacks –typical usage is as supplementary material to algorithm description document –is used to create test vectors 6

| PB173 - Group: Applied cryptography Reference vs. optimized version (2) Optimized version of algorithm –same results as reference implementation –portability usually impacted Techniques used –pre-computed tables often –may use whole size of the architecture registers e.g., AES is byte oriented, but x64 can perform eight xor of single byte per tick –may use special instruction of particular CPU –may use specifics of target architecture (e.g., cache size) Typically for the production environment 7

| PB173 - Group: Applied cryptography Choosing the right length 8

| PB173 - Group: Applied cryptography Length of keys/block/hashes Choose length with some reserve –many things can go wrong Choose algorithms with corresponding lengths –key derivation by MD5 of keys for AES256? Do not protect keys distribution by keys with lower entropy –AES key encrypted by simple DES key Asymmetric keys length needs to be much longer –space of possible values is not continuous 9

| PB173 - Group: Applied cryptography Comparable strengths of cryptosystems Source: NIST SP800 10

| PB173 - Group: Applied cryptography Recommended key sizes Source: NIST SP800 11

| PB173 - Group: Applied cryptography Symmetric key cryptography Key length for symmetric cryptography –80 bits not secure enough against brute-force –always good to have some reserve for algorithm flaws flaw => key can be found faster then by brute-force AES-128 is still OK AES-256 do not have full 256 bits of security Take your application needs into account! 12

| PB173 - Group: Applied cryptography Making the keys From what are you making the keys? –password must have entropy equivalent to derived key –e.g., AES-128 key derived from “hello” will not have 128 bits security What if you create two keys from one with 128 bits of entropy? Do you really have perfect random generator? –128 generated bits will not have 128 bits of entropy –generate more bits and use hash function to condense into 128 bits ( Seems that NSA was involved in intentional crippling of random generators – implementation and even standards) 13

| PB173 - Group: Applied cryptography Asymmetric cryptography RSA is still gold standard –use (at least) 2048 bits keys –768 bits broken by brute-force –special number with 1024 bits broken by brute-force –1024 bits not broken yet, but… Elliptic courve cryptography (ECC) seems cool –Currently (2013), some doubts about ECC security based on leaked Snowden documents arise –But do you really need shorter keys? –You will face harder portability, more coding problems, lower level of code testiness etc. 14

| PB173 - Group: Applied cryptography Practical assignment 15

PB173 Teams 2-3 persons Joint work, but every one presents its contribution –Presentation on next seminar Use GitHub + Travis CI Form the teams now! –Team A: Kristian Jakubik, Peter Kovac, Peter Lipcak –Team B: Martina Minatova, Marek Santa, Peter Harmann –Team C: Peter Sekan, Marek Vancik, Jakub Martinka 16

"Theme" project – Secure IM Secure instant messaging and data sharing | PB173 - Group: Applied cryptography 17

| PB173 - Group: Applied cryptography "Theme" project – Secure IM Certification authority –validates and issue user certificates IM server –register and faciliate connection between users Client –provides operations related to end user usage Expected at the end: working networking application with security features 18

| PB173 - Group: Applied cryptography "Theme" project – some details Users obtains certificate of identity from Certification authority Users register with IM server IM server provides list of connected users, helps to establish connection if necessary Client maintains user identity, related keys and provides exchange of IM messages and high speed encrypted transfer of data stream 19

| PB173 - Group: Applied cryptography Practical assignment 1.Select great name for your group 2.Setup development workflow for your group –New Github repository (separate folder for client&server), license –Add proper developer rights –Initial version of code/tests (just copy from last lecture) –Try to pull/commits together and create conflict (intentionally) 3.Send me link to your repo (+ members of the group) 4.Plan together your work –Design based on requirements gathered now –Add initial issues into separate milestones 20

Practical assignment – cont. 4.Prepare document and presentation with design decisions –2-3xA4 document (overview, functions, crypto used...) –4-5 slides (presentation) –UML diagrams? Your design will be presented and discussed next week PB173 21

Practical assignment Design and document API to: –new user registration –user authentication to server –obtain list of other users –establish secure channel to other (online) users (ENC, MAC) –exchange instant messages (small data packets) with other user –close secure channel –disconnect user from server –...? Document functions in JavaDoc-style (Doxygen) CA/Client/Server are separate processes –Plan for communication over sockets or http requests 22 PB173

Principles of good API 1.Be minimal 2.Be complete 3.Have clear and simple semantics 4.Be intuitive 5.Be easy to memorize 6.Lead to readable code read more at e.g., security API even harder: PB173 23

Submissions, deadlines Upload application source codes as single zip file into IS Homework vault (Crypto - 3. homework (UT)) –Initial version of project at GitHub, structure, initial code&tests –Design documents (doc folder) –Header files with documented (Doxygen) function headers (API) –Slides for presentation DEADLINE :00 –Up to 10 points assigned 24 | PB173 - Group: Applied cryptography

Questions? 25