Advanced Programming of Cryptographic Methods

C Language

  1. Introduction to C and GCC. How to compile and run a program from a Linux console. Passing paramaters to a program: argc and argv. Programs: Hello and ASCII table in C.
  2. Bit operators in C. Programs: Printing a word in hexadecimal and binary format, rotate a word, compute the Hamming weight. Creation and usage of a library in C.
  3. Using files in C. Programs : Hexadecimal visualizer of a file; Caesar cipher of an ASCII file; Checking the integrity of a file by XOR and fread.
  4. Struct and dinamic structures. Programs: list and binary trees in C; a word counter in C.
  5. Stream Cipher and permutations in C: ARC4. Programs: Setup of ARC4, Pseudorandom generator by ARC4, (de)cipher by ARC4.
  6. Stream Cipher and finite fields: A5/1 and LFSR. Programs: Printing all the non-zero elements of the 3 registers of A5/1 (LFSR) ; Implementing the majority function and printing the states; (De)cipher with A5/1.
  7. Block cipher: AES128. Programs : Key schedule, Step by step ciphering by SBox, ShiftRows and MixColumns, AES with ECB mode, AES with CBC mode. The CTR mode.
  8. Pseudo random number generators (PRNG) and first steps with Gnu Multi Precision arithmetic library (GMP). Programs : Default PRNG by ANSI C, Linear PRNG and its period, AES as PRNG, Blum Blum Shub PRNG using GMP.
  9. RSA algorithm with GMP. Programs: Private and public key generator, cipher a short message from the console to a file using the public key, decipher the message from the file to the console using CRT and the private key.

Java Language

  1. Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
  2. The Bouncy castle provider.
  3. Symmetric block cipher: DES/AES/ARC4. Mode: ECB/CBC/CTR. Padding: PKCS7. Inline initial vector. Programs: Bytes counter of a file, Hexadecimal visualizer, (de)cipher a file of short and big dimension.
  4. Hash function and HMAC: Tampering a message.
  5. BigInt and pseudo prime generators.
  6. RSA key generation. OAEP Padding. Session key and Iv exchange.
  7. Launching a C program from Java. Sleep in C on different platforms.

Bibliography

  1. B. Kernighan, D. Ritchie, The C programming language, Second edition, Prentice Hall.
  2. A. Beutelspacher, Cryptography in C and C++, Second edition, APress.
  3. GMP Development Team, The GNU Multiple Precision Arithmetic Library, ver 6.1.2.
  4. D. Hook, Beginning Cryptography with Java, Wrox Press.