6.375 Final Presentation Jeff Simpson, Jingwen Ouyang, Kyle Fritz FPGA Implementation of Whirlpool and FSB Hash Algorithms.

Slides:



Advertisements
Similar presentations
Hash Functions A hash function takes data of arbitrary size and returns a value in a fixed range. If you compute the hash of the same data at different.
Advertisements

System Integration and Performance
Comparison of Altera NIOS II Processor with Analog Device’s TigerSHARC
Lecture 5: Cryptographic Hashes
Lecture 7 Overview. Advanced Encryption Standard 10, 12, 14 rounds for 128, 192, 256 bit keys – Regular Rounds (9, 11, 13) – Final Round is different.
“Advanced Encryption Standard” & “Modes of Operation”
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
TIE Extensions for Cryptographic Acceleration Charles-Henri Gros Alan Keefer Ankur Singla.
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Symmetric Encryption Example: DES Weichao Wang. 2 Overview of the DES A block cipher: – encrypts blocks of 64 bits using a 64 bit key – outputs 64 bits.
1 Chapter 5 Hashes and Message Digests Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
Kazi Spring 2008CSCI 6601 CSCI-660 Introduction to VLSI Design Khurram Kazi.
1 The AES block cipher Niels Ferguson. 2 What is it? Block cipher: encrypts fixed-size blocks. Design by two Belgians. Chosen from 15 entries in a competition.
Announcements: 1. HW7 due next Tuesday. 2. Inauguration today! Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman,
Announcements:Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman, ElGamal Hash Functions and SHA-1 Hash Functions.
MD5 Message Digest Algorithm CS265 Spring 2003 Jerry Li Computer Science Department San Jose State University.
Hashes and Message Digest Hash is also called message digest One-way function: d=h(m) but no h’(d)=m –Cannot find the message given a digest Cannot find.
Chapter 4  Hash Functions 1 Overview  Cryptographic hash functions are functions that: o Map an arbitrary-length (but finite) input to a fixed-size output.
1 Overview of the DES A block cipher: –encrypts blocks of 64 bits using a 64 bit key –outputs 64 bits of ciphertext A product cipher –basic unit is the.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
Module 4 Hash Functions Highline Community College Seattle University University of Washington in conjunction with the National Science Foundation.
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
The Design of Improved Dynamic AES and Hardware Implementation Using FPGA 游精允.
Cryptography and Network Security Chapter 5. Chapter 5 –Advanced Encryption Standard "It seems very simple." "It is very simple. But if you don't know.
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
Lecture 13 Message Signing
Encryption Schemes Second Pass Brice Toth 21 November 2001.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Digital signature using MD5 algorithm Hardware Acceleration
MICROPROCESSOR INPUT/OUTPUT
Blowfish A widely used block cipher. Blowfish Designed by Bruce Schneier (1993) A variant of it (Twofish) was an AES finalist candidate 64-bit block size,
1 Hashes and Message Digests. 2 Hash Also known as –Message digest –One-way function Function: input message -> output One-way: d=h(m), but not h’(d)
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Array Synthesis in SystemC Hardware Compilation Authors: J. Ditmar and S. McKeever Oxford University Computing Laboratory, UK Conference: Field Programmable.
Hash and MAC Functions CS427 – Computer Security
A Case for a Parallelizable Hash Alan Kaminsky and Stanislaw Radziszowski Department of Computer Science B. Thomas Golisano College of Computing and Information.
Hash and Mac Algorithms. Contents Hash Functions Secure Hash Algorithm HMAC.
6fb52297e004844aa81be d50cc3545bc Hashing!. Hashing  Group Activity 1:  Take the message you were given, and create your own version of hashing.  You.
LZRW3 Decompressor dual semester project Part A Mid Presentation Students: Peleg Rosen Tal Czeizler Advisors: Moshe Porian Netanel Yamin
Cryptographic Hash Functions and Protocol Analysis
Lecture 23 Symmetric Encryption
Cryptographic Hash Functions Prepared by Dr. Lamiaa Elshenawy
Advanced Encryption Standard Dr. Shengli Liu Tel: (O) Cryptography and Information Security Lab. Dept. of Computer.
RTL Design Methodology Transition from Pseudocode & Interface
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
1 Chapter 12: Hash and MAC Algorithms Fourth Edition by William Stallings Lecture slides by Lawrie Brown (modified by Prof. M. Singhal, U of Kentucky)
Lecture 5B Block Diagrams HASH Example.
Cryptographic Hash Functions
MICROPROGRAMMED CONTROL
Lecture 3 RTL Design Methodology Transition from Pseudocode & Interface to a Corresponding Block Diagram.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 10 September 21, 2004.
Encryption / Decryption on FPGA Final Presentation Written by: Daniel Farcovich ID Saar Vigodskey ID Advisor: Mony Orbach Summer.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Cipher Transmission and Storage Modes Part 2: Stream Cipher Modes CSCI 5857: Encoding and Encryption.
Information Security and Management 11. Cryptographic Hash Functions Chih-Hung Wang Fall
1 Message Authentication using Message Digests and the MD5 Algorithm Message authentication is important where undetected manipulation of messages can.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 13.Message Authentication.
Encryption / Decryption on FPGA Midterm Presentation Written by: Daniel Farcovich ID Saar Vigodskey ID Advisor: Mony Orbach Summer.
The Federal Information Processing Standards (FIPS) Encryption Suite Sean Smith COSC
RTL Design Methodology Transition from Pseudocode & Interface
School of Computer Science and Engineering Pusan National University
Blowfish Algorithm.
ICS 454 Principles of Cryptography
ICS 454 Principles of Cryptography
ECE 352 Digital System Fundamentals
RTL Design Methodology Transition from Pseudocode & Interface
RTL Design Methodology Transition from Pseudocode & Interface
Cryptography Lecture 18.
Chapter 13: I/O Systems.
Presentation transcript:

6.375 Final Presentation Jeff Simpson, Jingwen Ouyang, Kyle Fritz FPGA Implementation of Whirlpool and FSB Hash Algorithms

Outline Overview Test Harness Hash Algorithms – Whirlpool – FSB Closing Remarks

Outline Overview Test Harness Hash Algorithms – Whirlpool – FSB Closing Remarks

What is a Hash? A hash is a fingerprint of sorts – a small key which can be used to identify a larger data set. Hashes have many uses – Identifying that a data set is correct. – Performing database indexing – Cryptographic functions

SHA-3 Competition National Institute of Science and Technology (NIST) is holding a competition to write the successor to the SHA-2 hashing algorithm. Over 50 algorithms have been submitted for consideration. NIST will make the final decision, but the community is performing analysis and making recommendations.

Project Goals Implementation of hash algorithms on the Altera DE2-70 FPGA – Whirlpool hash – FSB hash (SHA-3 candidate, uses Whirlpool) The process and results of implementing the SHA-3 candidate algorithm will serve as an analysis of the algorithm.

Outline Overview Test Harness Hash Algorithms – Whirlpool – FSB Closing Remarks

Test Harness Provide a layer of abstraction Simplify memory access Provide FPGA interface Provide simple and fast end-to-end testing

Hash Abstraction Put Length Put Word Get Hash Get Table Lookup Put Table Lookup Response Hash does not need to know anything about memory organization, addressing, or interface Test harness does not need to know anything about the Hash function.

Memory :040105F – NIOS (4KB) :0417FFF – Input Message (32KB) :0447FFF – Hash Memory (32KB) :17FFFFF – Lookup Tables (8MB, Flash)

On FPGA Intel HEX file is generated from test-case data for loading FPGA Altera flash image is generated from lookup table NIOS signals for the hash to start, then reads the result from memory when the hash has completed.

In Simulation Verilog VMH file generated from test-case data, AND lookup table. Hash is commanded to start automatically. Result is displayed (saved to output log file)

Message Input VMH // Message size in bits // Data // Result //Lookup table data (simulation only)

Testing A suite of test-cases is used for automated testing Reference hashes are automatically generated and compared to the simulation results. FPGA results can be automatically compared in the same fashion. A NIOS-based message generator is used to test message input > 32KB

Outline Overview Test Harness Hash Algorithms – Whirlpool – FSB Closing Remarks

Typical Hash Structure PreprocessingCompressionFinalization F

Preprocessing 491daf Typical Hash Structure CompressionFinalization F

Typical Hash Structure PreprocessingCompressionFinalization F 491daf3c

Typical Hash Structure PreprocessingCompressionFinalization F 491daf 3c

Typical Hash Structure PreprocessingCompressionFinalization F 491daf 3c

Typical Hash Structure PreprocessingCompressionFinalization F 46a931ff 3c8020

Typical Hash Structure PreprocessingCompressionFinalization F 46a931ff 3c8020

Typical Hash Structure PreprocessingCompressionFinalization F a903bd55

Typical Hash Structure PreprocessingCompressionFinalization F a903bd5503bd55

Outline Overview Test Harness Hash Algorithms – Whirlpool – FSB Closing Remarks

Whirlpool Introduction A stand-alone hash function based on a substantially modified Advanced Encryption Standard (AES) Given a message less than bits in length, it returns a 512-bit message digest. Whirlpool is not a SHA-3 candidate Will never be patented, free for public use No Bluespec implementations exist

Whirlpool Preprocessing Input: A input message being hashed (any size) Padded input: – A ={ message,1, 0,0,0,…,0,0,0} (512N bits) – B =message length (256 bits) – Padded input = {A,B} (512 N bits) Output: Split the padded input to small message blocks (512 bits each) Message bits 1Zeroes Length

Whirlpool Preprocessor Input words are shifted into the message block one bit at a time until any of the following events: – Message block is full: It is sent and a new one is started. – Input word is finished: The next one is loaded. – Message is complete: The block is padded with a 1 and the message length (in bits) before being sent. Because these events happen independently, the preprocessor does not depend on message size, message block size or input word size. It requires very little logic, but is rather slow, as it requires 1 cycle per bit, minimally. Input Words Message Block

Whirlpool Compression Inputs: – Current hash from previous iteration (8 bit x 64 vector) – Small message blocks (512 bit) Output: – Intermediate Hash (8 bit x 64 vector) W

Whirlpool Compression Block Diagram : – init: takes in message blocks and resets internal states – processBuffer: computes internal state from an internal block cipher – finalize: newHash = currentHash ^ input message ^ state newHash is sent out as result when there is no more input message blocks initprocessBufferfinalize

Whirlpool Compression Internal block cipher in processBuffer: – Originally uses a randomly generated box, lack internal structure, hard to implement efficiently in hardware – Current version uses S-box, which has nice patterns for hardware implementation

Whirlpool Implementation Do one branch at a time – Reuse hardware – Save logic – Take longer time 10 rounds of iteration – Big for-loop takes a lot of logic, and increases critical path – Use counter to break into multiple cycles

Whirlpool Implementation Use registers with ready bits instead of FIFOs Put s-box’s lookup table onto SRAM – One table lookup per cycle Concatenate vectors to avoid multi-layered MUX C3 C2 C1 C0 C3[2] C2[1] C1[3] C0[0] C2[1] C[9] C[15:12] C[11: 8] C[ 7: 4] C[ 3: 0] C = {c3,c2,c1,c0}

Whirlpool Finalization Functionality: – Unwrap the intermediate hash from its vector form to a bit string as final output (8 bit x 64 vector => 512 bit string) No separate finalization module – Done at the end of the compression module

Whirlpool Result Successfully simulated and verified in Bluespec compiler Successfully put onto FPGA and verified Noticeable trade-offs between speed and area – We choose area over speed

Outline Overview Test Harness Hash Algorithms – Whirlpool – FSB Closing Remarks

Fast Syndrome-Based hash function FSB is a family of hash functions submitted to the SHA-3 competition. Maintains a large internal state. Requires a large lookup table. Simple design, simple operations. Proof of reduction to known hard problems. Authors are French.

FSB Preprocessing Message blocks of 1240 bits. Filled first with bits from message. After last message input, single bit appended. Padded with zeroes. Last 64 bits contain message length in bits. Message bits 1Zeroes Length

FSB Compression 1101… 01001… 10110… Simple Math with Constants % / Memory >> π 1984 bits 1240 bits 8 bits 5 bits 1987 bits x bits 21 bits

FSB Compression Implementation follows specification closely. Single cycle division and modulo component. Multiple cycle shifter. Memory interface for loading pi vectors.

FSB Finalization Whirlpool 512 bits1984 bits Breaks up 1984 bits into a stream of 32 bit input words for Whirlpool.

Closing Remarks FSB is not ideal for hardware. – Large lookup table. – Large internal state. – Simple operations on large values. Generalized code can be reused for other hash functions.