
    

    <?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://ocw.cs.pub.ro/courses/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://ocw.cs.pub.ro/courses/feed.php">
        <title>CS Open CourseWare ic:laboratoare</title>
        <description></description>
        <link>http://ocw.cs.pub.ro/courses/</link>
        <image rdf:resource="http://ocw.cs.pub.ro/courses/lib/tpl/arctic/images/favicon.ico" />
       <dc:date>2026-06-10T11:59:53+03:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/01?rev=1603025722&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/02?rev=1603107522&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/03?rev=1603663434&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/04?rev=1604272134&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/05?rev=1604491241&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/06?rev=1604390686&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/07?rev=1541420753&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/08?rev=1604588486&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/09?rev=1604591667&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/10?rev=1604591563&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/11?rev=1604591608&amp;do=diff"/>
                <rdf:li rdf:resource="http://ocw.cs.pub.ro/courses/ic/laboratoare/12?rev=1475064125&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://ocw.cs.pub.ro/courses/lib/tpl/arctic/images/favicon.ico">
        <title>CS Open CourseWare</title>
        <link>http://ocw.cs.pub.ro/courses/</link>
        <url>http://ocw.cs.pub.ro/courses/lib/tpl/arctic/images/favicon.ico</url>
    </image>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/01?rev=1603025722&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-18T15:55:22+03:00</dc:date>
        <title>Laboratorul 01 - Introduction</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/01?rev=1603025722&amp;do=diff</link>
        <description>Laboratorul 01 - Introduction

Python3 Crash Course

Check-out this tutorial: here.

Encoding vs Encryption

Encoding

	*  Is used to transform data from one format to another.
	*  Typically used in data transfer between different systems.
	*  The information is NOT kept secret!!!
	*  To decode the encoded data you only need to know the algorithm that was used.</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/02?rev=1603107522&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-19T14:38:42+03:00</dc:date>
        <title>Laboratorul 02 - Shift and Vigenère Ciphers</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/02?rev=1603107522&amp;do=diff</link>
        <description>Laboratorul 02 - Shift and Vigenère Ciphers

Please download the lab skeleton from here: 
The archive contains the following:

	*  format_funcs.py: the format functions from the previous lab;
	*  caesar.py: the implementation of the Caesar encryption and decryption from the previous lab;
	*  msg_ex1.txt: the text which needs to be decrypted for exercise 1;
	*  msg_ex2.txt: the text which needs to be decrypted for exercise 2;
	*  msg_ex3.txt: the text which needs to be decrypted for exercise 3;
	…</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/03?rev=1603663434&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-26T00:03:54+03:00</dc:date>
        <title>Laboratorul 03 - PRGs</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/03?rev=1603663434&amp;do=diff</link>
        <description>Laboratorul 03 - PRGs


import base64

# CONVERSION FUNCTIONS

def _chunks(string, chunk_size):
    for i in range(0, len(string), chunk_size):
        yield string[i:i+chunk_size]

def _hex(x):
    return format(x, '02x')

def hex_2_bin(data):
    return ''.join(f'{int(x, 16):08b}' for x in _chunks(data, 2))

def str_2_bin(data):
    return ''.join(f'{ord(c):08b}' for c in data)

def bin_2_hex(data):
    return ''.join(f'{int(b, 2):02x}' for b in _chunks(data, 8))

def str_2_hex(data):
    retu…</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/04?rev=1604272134&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-02T01:08:54+03:00</dc:date>
        <title>Laboratorul 04 - PRFs, PRPs, SPNs</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/04?rev=1604272134&amp;do=diff</link>
        <description>Laboratorul 04 - PRFs, PRPs, SPNs


import base64

# CONVERSION FUNCTIONS
def _chunks(string, chunk_size):
    for i in range(0, len(string), chunk_size):
        yield string[i:i+chunk_size]

# THIS ONE IS NEW
def byte_2_bin(bval):
    &quot;&quot;&quot;
      Transform a byte (8-bit) value into a bitstring
    &quot;&quot;&quot;
    return bin(bval)[2:].zfill(8)

def _hex(x):
    return format(x, '02x')

def hex_2_bin(data):
    return ''.join(f'{int(x, 16):08b}' for x in _chunks(data, 2))

def str_2_bin(data):
    return …</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/05?rev=1604491241&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-04T14:00:41+03:00</dc:date>
        <title>Laboratorul 05 - DES</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/05?rev=1604491241&amp;do=diff</link>
        <description>Laboratorul 05 - DES

In this lab we'll do some exercises with DES and some of its variants, as we discussed in the last lecture here.


import base64

# CONVERSION FUNCTIONS
def _chunks(string, chunk_size):
    for i in range(0, len(string), chunk_size):
        yield string[i:i+chunk_size]

def byte_2_bin(bval):
    return bin(bval)[2:].zfill(8)

def _hex(x):
    return format(x, '02x')

def hex_2_bin(data):
    return ''.join(f'{int(x, 16):08b}' for x in _chunks(data, 2))

def str_2_bin(data)…</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/06?rev=1604390686&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-03T10:04:46+03:00</dc:date>
        <title>Laboratorul 06 - AES Byte at a Time ECB Decryption</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/06?rev=1604390686&amp;do=diff</link>
        <description>Laboratorul 06 - AES Byte at a Time ECB Decryption

AES ECB

The simplest of the encryption modes is the Electronic Codebook (ECB) mode (named after conventional physical codebooks). The message is divided into blocks, and each block is encrypted separately.</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/07?rev=1541420753&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-11-05T14:25:53+03:00</dc:date>
        <title>Laboratorul 07 - Correlation Power Analysis</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/07?rev=1541420753&amp;do=diff</link>
        <description>Laboratorul 07 - Correlation Power Analysis

In this lab we'll implement a side-channel attack known as Correlation Power Analysis.

The principle is quite simple:

	*  Choose your target (generally the S-box output of some block cipher - in our case AES)
	*  Obtain a large number (thousands) of leakage samples for that target, when processing different plaintexts
	*  Choose a suitable leakage model (usually the hamming weight of the target value)
	*  For each possible key candidate (e.g. all va…</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/08?rev=1604588486&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-05T17:01:26+03:00</dc:date>
        <title>Laboratorul 08 - MACs</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/08?rev=1604588486&amp;do=diff</link>
        <description>Laboratorul 08 - MACs

In this lab we'll do some exercises with Message Authentication Codes.

Exercise 1 - Existential Unforgeability

In this exercise we will attack an insecure MAC algorithm by showing that an adversary can forge a (message, tag) pair without first querying a  oracle with the message.</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/09?rev=1604591667&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-05T17:54:27+03:00</dc:date>
        <title>Laboratorul 09 - OpenSSL MACs, Hashes and AEAD</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/09?rev=1604591667&amp;do=diff</link>
        <description>Laboratorul 09 - OpenSSL MACs, Hashes and AEAD

Exercise 1

In this exercise we'll use the command line to compute an HMAC, with SHA-1 as the hashing algorithm.

Recall from the lecture that for HMAC to be secure, we need to sample a random key .

We can generate random bytes using openssl rand. To compute HMACs, check the documentation for openssl dgst.</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/10?rev=1604591563&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-05T17:52:43+03:00</dc:date>
        <title>Laboratorul 10 OLD - OpenSSL AEAD</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/10?rev=1604591563&amp;do=diff</link>
        <description>Laboratorul 10 OLD - OpenSSL AEAD

Before you start solving the exercises below, download the [lab archive from here].

Exercise 1

The archive contains the source code for Exercise 2, but sadly it is encrypted. Luckily, we forgot to remove the password file from the archive.</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/11?rev=1604591608&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-05T17:53:28+03:00</dc:date>
        <title>Laboratorul 10 - Public key encryption</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/11?rev=1604591608&amp;do=diff</link>
        <description>Laboratorul 10 - Public key encryption

In this lab we'll do some cool exercises using public key encryption methods for key exchange and data encryption.

Exercise 1: Diffie-Hellman key exchange (4p)

As we discussed in class, Diffie and Hellman proposed the first public key exchange mechanism such that
two parties, that did not share any previous secret could establish a common secret. This allows
the parties to have a shared key that only they know (except if there is an active man in the mid…</description>
    </item>
    <item rdf:about="http://ocw.cs.pub.ro/courses/ic/laboratoare/12?rev=1475064125&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-09-28T15:02:05+03:00</dc:date>
        <title>Laboratorul 12.</title>
        <link>http://ocw.cs.pub.ro/courses/ic/laboratoare/12?rev=1475064125&amp;do=diff</link>
        <description>Laboratorul 12.</description>
    </item>
</rdf:RDF>
