├── README.md ├── Dockerfile ├── birthdayAttck.java ├── BinaryVernam.java ├── docker.txt ├── Caesar.java ├── FindIt.java ├── SimpleHash.java ├── ECB.java ├── HMACExample.java ├── CTR.java ├── CBC.java └── GCM.java /README.md: -------------------------------------------------------------------------------- 1 | # PracticalCrypto 2 | Practical Cryptography Class 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | MAINTAINER Kasun De Zoysa 3 | RUN apt-get update 4 | RUN apt-get install -y openssl 5 | -------------------------------------------------------------------------------- /birthdayAttck.java: -------------------------------------------------------------------------------- 1 | /* 2 | Kasun De Zoysa @ UCSC 3 | */ 4 | import java.io.*; 5 | import java.util.*; 6 | 7 | public class birthdayAttck{ 8 | 9 | public static void main(String args[]) { 10 | Random rand = new Random(); 11 | int n; 12 | //for (int t = 0; t < 10; t++) { 13 | Set b = new HashSet(); 14 | while (true) { 15 | n = rand.nextInt(365); 16 | if (!b.add(n)) break; 17 | } 18 | System.out.println("SET->"+b); 19 | System.out.println("Birthbday->"+n+" Size->"+b.size()); 20 | // } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /BinaryVernam.java: -------------------------------------------------------------------------------- 1 | public class BinaryVernam{ 2 | 3 | public static void main(String args[]){ 4 | char plain[]={'K','A','S','U','N'}; 5 | char cipher[]=new char[5]; 6 | char key[]={10,25,33,44,56}; 7 | int i,p,c; 8 | 9 | //Encryption 10 | System.out.print("Encryption: "); 11 | for(i=0;i