SlideShare a Scribd company logo
1 of 40
Download to read offline
Effective Software
Implementation of
Advanced Encryption Standard
December 2014
Roman Oliynykov
Professor at
Information Technologies Security Department
Kharkov National University of Radioelectronics
Head of Scientific Research Department
JSC โ€œInstitute of Information Technologiesโ€
Ukraine
Visiting professor at
Samsung Advanced Technology Training Institute
Korea
ROliynykov@gmail.com
Outline
๏ฌ A few words about myself
๏ฌ Brief history of AES/Rijndael
๏ฌ AES properties
๏ฌ Direct AES implementation and problems with it
๏ฌ Methods for effective encryption
implementation (proposed by Rijndael authors
in their submission to AES competition)
๏ฌ Decryption optimization
๏ฌ Conclusions
About myself (I)
๏ฌ Iโ€™m from Ukraine (Eastern part of
Europe),
host country of Euro2012 football
championship
๏ฌ I live in Kharkov (the second biggest
city in the country, population is 1.5
million people), Eastern Ukraine
(near Russia),
former capital of the Soviet Ukraine
(1918-1934)
three Nobel prize winners worked at
Kharkov University
About myself (II)
๏ฌ Professor at Information Technologies Security
Department at Kharkov National University of
Radioelectronics
๏ฌ courses on computer networks and operation
system security, special mathematics for
cryptographic applications
๏ฌ Head of Scientific Research Department at JSC
โ€œInstitute of Information Technologiesโ€
๏ฌ Scientific interests: symmetric cryptographic
primitives synthesis and cryptanalysis
๏ฌ Visiting professor at Samsung Advanced
Technology Training Institute
๏ฌ courses on computer networks and operation
system security, software security, effective
application and implementation of symmetric
cryptography
Modern and effective solution:
Advanced Encryption Standard (AES)
๏ฌ result of international public cryptographic competition
(1997-2000)
๏ฌ had been chosen among 15 candidate ciphers
(developed in the US, Belgium, Denmark, Germany,
Israel, Japan, Switzerland, Armenia, etc.)
๏ฌ original name is Rijndael (developed by researchers from
Belgium)
๏ฌ votes on 3rd AES conference had been given to this
cipher, but the rest Twofish (US), MARS (US, IBM), E2
(Japan, Camellia predecessor), Serpent (Israel) are also
remain strong
๏ฌ the most researched block cipher all over the world
(2014, open publications)
๏ฌ basis for development of many other symmetric primitives
AES properties
๏ฌ block length 128 bits only (subset of Rijndael which
supports 128, 192 and 256 bits)
๏ฌ key length is 128, 192 and 256 bits
๏ฌ uses Substitution-Permutation Network (SPN)
๏ฌ number of rounds (10,12,14) depends on key length
๏ฌ quite transparent design, algebraic structure
(theoretically may be vulnerable to algebraic
analysis)
๏ฌ quite effective in software (32-bit platforms) and
hardware implementation
AES parameters: key length,
block size, number of rounds
AES: presentation of processing
bytes as a โ€œcipher stateโ€
AES: main steps
๏ฌrunning key schedule procedure:
generation of all round keys
๏ฌrunning encryption or decryption
procedure
๏ฌ or, for compact hardware implementation,
sequential operations:
๏ฌ generation of the current round key
๏ฌ one encryption round
AES: high-level structure
(pseudocode)
AES: high-level structure
(picture for 128 bit key)
AES: SubBytes transformation
AES: ShiftRows
transformation
AES: MixColumns
transformation
AES: AddRoundKey
transformation
AES round key generation (key
expansion)
NB: not all key length (128, 192, 256) must be supported; for many
applications itโ€™s enough to have the single key length
AES round key generation:
RotWord
AES round key generation:
SubBytes
AES round key generation:
round constant application
NB: without Rcon there would be equal blocks in ciphertext if plaintext and
keys have equal blocks (1, 2 or 4 bytes repeats in plaintext and key)
AES round key sequence
AES decryption (direct
presentation): reverse operations
in different order
AES/Rijndael design goals
๏ฌ be extremely fast on 32 bit platforms (+++)
๏ฌ be compact on hardware implementation with
small number of gates (++)
๏ฌ possibility to implement cipher on 8-bit smart-
card processors actual for 1990th (++)
๏ฌ cryptographic strength (+)
Direct implementation of AES
round function: SubBytes
16 operations (byte substitution)
Direct implementation of AES
round function: ShiftRows
12 operations (byte permutation)
AES: MixColumns
transformation
60 operations (logical and conditional):
๏ฌ
3+ operations for each input byte (48+ total):
โ€ข shift and conditional XOR (mult by 02)
โ€ข XOR (mult by 03)
๏ฌ
3 XORs for each row (12 total)
Direct implementation of AES
round function
๏ฌ
SubBytes: 16 operations (byte substitution)
๏ฌ
ShiftRows: 12 operations (byte permutation)
๏ฌ
MixColumns: 60 or even more operations
(conditions will prevent effective pipelining)
๏ฌ
AddRoundKey: 16 operations (logical)
TOTAL: more than 102 operations per round
AES effective software
implementation: 32-bit platform
๏ฌ three different operations can be united
into the single (!) look-up table access:
๏ฌ SubBytes (non-linear)
๏ฌ ShiftRows (linear)
๏ฌ MixColumns (linear)
๏ฌ cipher consists of look-up table accesses and
round key additions
AES effective software
implementation: MixColumns
Matrix multiplication: 7 operations (4 memory look-ups + 3
XORs) instead of 60:
๏ฌ
32-bit XOR of 4 columns
๏ฌ
each column depends on one input byte only
๏ฌ
all 4 bytes in each column are precomputed and stored in
advance
AES round function operations
sequence variants:
Original:
๏ฌ
SubBytes
๏ฌ
ShiftRows
๏ฌ
MixColumns
Equivalent:
๏ฌ
ShiftRows
๏ฌ
SubBytes
๏ฌ
MixColumns
AES effective software implementation:
MixColumns and SubBytes at one
precomputed table
SubBytes and MixColumns: 7 operations (4 memory look-ups + 3
XORs) total:
๏ฌ
32-bit XOR of 4 columns
๏ฌ
each column depends on one input byte only (already sent throw
S-box)
๏ฌ
all 4 bytes in each column are precomputed and stored in advance
Fragment of OpenSSL AES source
code (based on Rijndael author's
implementation)
4 tables are needed; size of each table is 256 * 4 = 1 kByte
Fragment of OpenSSL AES source
code (based on Rijndael author's
implementation)
ShiftRows is implemented as usual shift and mask of 32-bit register;
SubBytes and MixColumns are implemented as memory lookups (8 bit โ†’ 32 bit)
AES effective software implementation:
extra memory optimization
Decreasing memory amount: single table (1 kByte instead of
4 tables of 1 kB each)
Main table size for the fastest and
compact optimized 32-bit AES
implementation
๏ฌ fastest:
๏ฌ (4 bytes) x (256 different entries to S-box) x
x (4 different positions for ShiftRow) == 4 kbytes
๏ฌ compact optimized:
๏ฌ (4 bytes) x (256 different entries to S-box) ==
== 1 kbyte
๏ฌ three additional operations in C ( << , >>, | or ^)
are needed besides a table look-up
NB: for reaching highest performance precomputed tables and processing data
must fit into L1 processor cache (32-64kBytes for modern processors)
Number of 32-bit operations needed for a
single block encryption at main
transformation (having all round keys)
๏ฌ ( (4 look-up) + (3 xors) ) * (4 columns) ==
== 28 operations / round
๏ฌ 4 xors with round keys ==
== 4 operations / round
๏ฌ (28 + 4) * (9 rounds) == 288 operations for high
strength encryption of 9 rounds (!)
๏ฌ (16 operations on SubBytes) + (24 operations on
ShiftRows) + (4 xors with round keys) ==
== 44 operations at last round
AES decryption: high-level
structure (pseudocode)
AES decryption: optimization
๏ฌ SubBytes() and ShiftRows() transformations
commute, their sequence can be chaged
๏ฌ The column mixing operations -
MixColumns() and InvMixColumns() โ€“ are
linear with respect to the column input, which
means InvMixColumns(state xor Round Key)
== InvMixColumns(state) xor
InvMixColumns(Round Key)
AES optimized decryption with
changed round keys
Additional details on AES
implementation
๏ฌ two set of tables for encryption
๏ฌ main optimized set (MixColumns, ShiftRows and
SubBytes)
๏ฌ separate S-box array for the last round
๏ฌ two set of tables for decryption (complexity is
the same as for encryption)
๏ฌ main optimized set (InvMixColumns, InvShiftRows
and InvSubBytes)
๏ฌ separate reverse S-box array for the last round
NB: ECB decryption is not needed for the most block cipher modes of operation
Conclusions
๏ฌ direct AES implementation is very slow (requires
many byte operations and conditions)
๏ฌ three different round function operations can be
united into the single look-up table access
๏ฌ with effective implementation AES consists of look-
up table accesses and round key additions
๏ฌ the fastest version AES requires 4 kB of memory for
tables, fast but compact requires 1 kB
๏ฌ fast AES decryption operation has the same speed
as encryption and uses changed order of round
function operations with modified round keys

More Related Content

What's hot

Image encryption using aes key expansion
Image encryption using aes key expansionImage encryption using aes key expansion
Image encryption using aes key expansion
Sreeda Perikamana
ย 

What's hot (20)

Block ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptographyBlock ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptography
ย 
Evolution of intel 4004 to i9.pptx
Evolution of intel 4004 to i9.pptxEvolution of intel 4004 to i9.pptx
Evolution of intel 4004 to i9.pptx
ย 
Advanced encryption standard (aes)
Advanced encryption standard (aes)Advanced encryption standard (aes)
Advanced encryption standard (aes)
ย 
Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)
ย 
RC 4
RC 4 RC 4
RC 4
ย 
Data representation
Data representationData representation
Data representation
ย 
Twofish
TwofishTwofish
Twofish
ย 
modified aes algorithm using multiple s-boxes
modified aes algorithm using multiple s-boxesmodified aes algorithm using multiple s-boxes
modified aes algorithm using multiple s-boxes
ย 
Hamming code checksum
Hamming code  checksumHamming code  checksum
Hamming code checksum
ย 
Image encryption using aes key expansion
Image encryption using aes key expansionImage encryption using aes key expansion
Image encryption using aes key expansion
ย 
Ipsec
IpsecIpsec
Ipsec
ย 
DES-lecture (1).ppt
DES-lecture (1).pptDES-lecture (1).ppt
DES-lecture (1).ppt
ย 
Advanced Encryption Standard (AES)
Advanced Encryption Standard (AES)Advanced Encryption Standard (AES)
Advanced Encryption Standard (AES)
ย 
Idea(international data encryption algorithm)
Idea(international data encryption algorithm)Idea(international data encryption algorithm)
Idea(international data encryption algorithm)
ย 
Microprocessor 8086 notes
Microprocessor 8086 notesMicroprocessor 8086 notes
Microprocessor 8086 notes
ย 
Des
DesDes
Des
ย 
Modern block cipher
Modern block cipherModern block cipher
Modern block cipher
ย 
One time pad Encryption:
One time pad Encryption:One time pad Encryption:
One time pad Encryption:
ย 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption Standard
ย 
Hamming codes
Hamming codesHamming codes
Hamming codes
ย 

Similar to AES effecitve software implementation

A design of a fast parallel pipelined implementation of aes advanced encrypti...
A design of a fast parallel pipelined implementation of aes advanced encrypti...A design of a fast parallel pipelined implementation of aes advanced encrypti...
A design of a fast parallel pipelined implementation of aes advanced encrypti...
ijcsit
ย 
Renas Rajab Asaad
Renas Rajab Asaad Renas Rajab Asaad
Renas Rajab Asaad
Renas Rekany
ย 
Aes 128 192_256_bits_project_report
Aes 128 192_256_bits_project_reportAes 128 192_256_bits_project_report
Aes 128 192_256_bits_project_report
sakhi rehman
ย 

Similar to AES effecitve software implementation (20)

Network Security Lec4
Network Security Lec4Network Security Lec4
Network Security Lec4
ย 
Aes
AesAes
Aes
ย 
Aes
AesAes
Aes
ย 
icwet1097
icwet1097icwet1097
icwet1097
ย 
AES (Intro Advanced Encryption Standard).pptx
AES (Intro Advanced Encryption Standard).pptxAES (Intro Advanced Encryption Standard).pptx
AES (Intro Advanced Encryption Standard).pptx
ย 
Computer security module 2
Computer security module 2Computer security module 2
Computer security module 2
ย 
sheet7.pdf
sheet7.pdfsheet7.pdf
sheet7.pdf
ย 
paper7.pdf
paper7.pdfpaper7.pdf
paper7.pdf
ย 
lecture6.pdf
lecture6.pdflecture6.pdf
lecture6.pdf
ย 
doc7.pdf
doc7.pdfdoc7.pdf
doc7.pdf
ย 
Next generation block ciphers
Next generation block ciphersNext generation block ciphers
Next generation block ciphers
ย 
Ch05
Ch05Ch05
Ch05
ย 
Unit -2.ppt
Unit -2.pptUnit -2.ppt
Unit -2.ppt
ย 
Network security cs5
Network security cs5Network security cs5
Network security cs5
ย 
A design of a fast parallel pipelined implementation of aes advanced encrypti...
A design of a fast parallel pipelined implementation of aes advanced encrypti...A design of a fast parallel pipelined implementation of aes advanced encrypti...
A design of a fast parallel pipelined implementation of aes advanced encrypti...
ย 
A VHDL Implemetation of the Advanced Encryption Standard-Rijndael.pdf
A VHDL Implemetation of the Advanced Encryption Standard-Rijndael.pdfA VHDL Implemetation of the Advanced Encryption Standard-Rijndael.pdf
A VHDL Implemetation of the Advanced Encryption Standard-Rijndael.pdf
ย 
Renas Rajab Asaad
Renas Rajab Asaad Renas Rajab Asaad
Renas Rajab Asaad
ย 
Aes
AesAes
Aes
ย 
Aes 128 192_256_bits_project_report
Aes 128 192_256_bits_project_reportAes 128 192_256_bits_project_report
Aes 128 192_256_bits_project_report
ย 
AES.ppt
AES.pptAES.ppt
AES.ppt
ย 

More from Roman Oliynykov

More from Roman Oliynykov (8)

Cryptocurrency with central bank regulations: the RSCoin framework
Cryptocurrency with central bank regulations: the RSCoin frameworkCryptocurrency with central bank regulations: the RSCoin framework
Cryptocurrency with central bank regulations: the RSCoin framework
ย 
Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...
ย 
Kalyna block cipher presentation in English
Kalyna block cipher presentation in EnglishKalyna block cipher presentation in English
Kalyna block cipher presentation in English
ย 
Software Security
Software SecuritySoftware Security
Software Security
ย 
Block Ciphers Modes of Operation
Block Ciphers Modes of OperationBlock Ciphers Modes of Operation
Block Ciphers Modes of Operation
ย 
Kupyna
KupynaKupyna
Kupyna
ย 
Kalyna
KalynaKalyna
Kalyna
ย 
Software security
Software securitySoftware security
Software security
ย 

Recently uploaded

Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
SUHANI PANDEY
ย 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
SUHANI PANDEY
ย 
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
SUHANI PANDEY
ย 
๐Ÿ’š๐Ÿ˜‹ Bilaspur Escort Service Call Girls, 9352852248 โ‚น5000 To 25K With AC๐Ÿ’š๐Ÿ˜‹
๐Ÿ’š๐Ÿ˜‹ Bilaspur Escort Service Call Girls, 9352852248 โ‚น5000 To 25K With AC๐Ÿ’š๐Ÿ˜‹๐Ÿ’š๐Ÿ˜‹ Bilaspur Escort Service Call Girls, 9352852248 โ‚น5000 To 25K With AC๐Ÿ’š๐Ÿ˜‹
๐Ÿ’š๐Ÿ˜‹ Bilaspur Escort Service Call Girls, 9352852248 โ‚น5000 To 25K With AC๐Ÿ’š๐Ÿ˜‹
nirzagarg
ย 
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Chandigarh Call girls 9053900678 Call girls in Chandigarh
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
SUHANI PANDEY
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
SUHANI PANDEY
ย 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
ย 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
SUHANI PANDEY
ย 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
ย 
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
nilamkumrai
ย 

Recently uploaded (20)

Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
ย 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
ย 
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
ย 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
ย 
๐Ÿ’š๐Ÿ˜‹ Bilaspur Escort Service Call Girls, 9352852248 โ‚น5000 To 25K With AC๐Ÿ’š๐Ÿ˜‹
๐Ÿ’š๐Ÿ˜‹ Bilaspur Escort Service Call Girls, 9352852248 โ‚น5000 To 25K With AC๐Ÿ’š๐Ÿ˜‹๐Ÿ’š๐Ÿ˜‹ Bilaspur Escort Service Call Girls, 9352852248 โ‚น5000 To 25K With AC๐Ÿ’š๐Ÿ˜‹
๐Ÿ’š๐Ÿ˜‹ Bilaspur Escort Service Call Girls, 9352852248 โ‚น5000 To 25K With AC๐Ÿ’š๐Ÿ˜‹
ย 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
ย 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
ย 
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
ย 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
ย 
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)
WhatsApp ๐Ÿ“ž 8448380779 โœ…Call Girls In Mamura Sector 66 ( Noida)
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
ย 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
ย 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
ย 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
ย 
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
ย 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
ย 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
ย 
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
ย 

AES effecitve software implementation

  • 1. Effective Software Implementation of Advanced Encryption Standard December 2014 Roman Oliynykov Professor at Information Technologies Security Department Kharkov National University of Radioelectronics Head of Scientific Research Department JSC โ€œInstitute of Information Technologiesโ€ Ukraine Visiting professor at Samsung Advanced Technology Training Institute Korea ROliynykov@gmail.com
  • 2. Outline ๏ฌ A few words about myself ๏ฌ Brief history of AES/Rijndael ๏ฌ AES properties ๏ฌ Direct AES implementation and problems with it ๏ฌ Methods for effective encryption implementation (proposed by Rijndael authors in their submission to AES competition) ๏ฌ Decryption optimization ๏ฌ Conclusions
  • 3. About myself (I) ๏ฌ Iโ€™m from Ukraine (Eastern part of Europe), host country of Euro2012 football championship ๏ฌ I live in Kharkov (the second biggest city in the country, population is 1.5 million people), Eastern Ukraine (near Russia), former capital of the Soviet Ukraine (1918-1934) three Nobel prize winners worked at Kharkov University
  • 4. About myself (II) ๏ฌ Professor at Information Technologies Security Department at Kharkov National University of Radioelectronics ๏ฌ courses on computer networks and operation system security, special mathematics for cryptographic applications ๏ฌ Head of Scientific Research Department at JSC โ€œInstitute of Information Technologiesโ€ ๏ฌ Scientific interests: symmetric cryptographic primitives synthesis and cryptanalysis ๏ฌ Visiting professor at Samsung Advanced Technology Training Institute ๏ฌ courses on computer networks and operation system security, software security, effective application and implementation of symmetric cryptography
  • 5. Modern and effective solution: Advanced Encryption Standard (AES) ๏ฌ result of international public cryptographic competition (1997-2000) ๏ฌ had been chosen among 15 candidate ciphers (developed in the US, Belgium, Denmark, Germany, Israel, Japan, Switzerland, Armenia, etc.) ๏ฌ original name is Rijndael (developed by researchers from Belgium) ๏ฌ votes on 3rd AES conference had been given to this cipher, but the rest Twofish (US), MARS (US, IBM), E2 (Japan, Camellia predecessor), Serpent (Israel) are also remain strong ๏ฌ the most researched block cipher all over the world (2014, open publications) ๏ฌ basis for development of many other symmetric primitives
  • 6. AES properties ๏ฌ block length 128 bits only (subset of Rijndael which supports 128, 192 and 256 bits) ๏ฌ key length is 128, 192 and 256 bits ๏ฌ uses Substitution-Permutation Network (SPN) ๏ฌ number of rounds (10,12,14) depends on key length ๏ฌ quite transparent design, algebraic structure (theoretically may be vulnerable to algebraic analysis) ๏ฌ quite effective in software (32-bit platforms) and hardware implementation
  • 7. AES parameters: key length, block size, number of rounds
  • 8. AES: presentation of processing bytes as a โ€œcipher stateโ€
  • 9. AES: main steps ๏ฌrunning key schedule procedure: generation of all round keys ๏ฌrunning encryption or decryption procedure ๏ฌ or, for compact hardware implementation, sequential operations: ๏ฌ generation of the current round key ๏ฌ one encryption round
  • 16. AES round key generation (key expansion) NB: not all key length (128, 192, 256) must be supported; for many applications itโ€™s enough to have the single key length
  • 17. AES round key generation: RotWord
  • 18. AES round key generation: SubBytes
  • 19. AES round key generation: round constant application NB: without Rcon there would be equal blocks in ciphertext if plaintext and keys have equal blocks (1, 2 or 4 bytes repeats in plaintext and key)
  • 20. AES round key sequence
  • 21. AES decryption (direct presentation): reverse operations in different order
  • 22. AES/Rijndael design goals ๏ฌ be extremely fast on 32 bit platforms (+++) ๏ฌ be compact on hardware implementation with small number of gates (++) ๏ฌ possibility to implement cipher on 8-bit smart- card processors actual for 1990th (++) ๏ฌ cryptographic strength (+)
  • 23. Direct implementation of AES round function: SubBytes 16 operations (byte substitution)
  • 24. Direct implementation of AES round function: ShiftRows 12 operations (byte permutation)
  • 25. AES: MixColumns transformation 60 operations (logical and conditional): ๏ฌ 3+ operations for each input byte (48+ total): โ€ข shift and conditional XOR (mult by 02) โ€ข XOR (mult by 03) ๏ฌ 3 XORs for each row (12 total)
  • 26. Direct implementation of AES round function ๏ฌ SubBytes: 16 operations (byte substitution) ๏ฌ ShiftRows: 12 operations (byte permutation) ๏ฌ MixColumns: 60 or even more operations (conditions will prevent effective pipelining) ๏ฌ AddRoundKey: 16 operations (logical) TOTAL: more than 102 operations per round
  • 27. AES effective software implementation: 32-bit platform ๏ฌ three different operations can be united into the single (!) look-up table access: ๏ฌ SubBytes (non-linear) ๏ฌ ShiftRows (linear) ๏ฌ MixColumns (linear) ๏ฌ cipher consists of look-up table accesses and round key additions
  • 28. AES effective software implementation: MixColumns Matrix multiplication: 7 operations (4 memory look-ups + 3 XORs) instead of 60: ๏ฌ 32-bit XOR of 4 columns ๏ฌ each column depends on one input byte only ๏ฌ all 4 bytes in each column are precomputed and stored in advance
  • 29. AES round function operations sequence variants: Original: ๏ฌ SubBytes ๏ฌ ShiftRows ๏ฌ MixColumns Equivalent: ๏ฌ ShiftRows ๏ฌ SubBytes ๏ฌ MixColumns
  • 30. AES effective software implementation: MixColumns and SubBytes at one precomputed table SubBytes and MixColumns: 7 operations (4 memory look-ups + 3 XORs) total: ๏ฌ 32-bit XOR of 4 columns ๏ฌ each column depends on one input byte only (already sent throw S-box) ๏ฌ all 4 bytes in each column are precomputed and stored in advance
  • 31. Fragment of OpenSSL AES source code (based on Rijndael author's implementation) 4 tables are needed; size of each table is 256 * 4 = 1 kByte
  • 32. Fragment of OpenSSL AES source code (based on Rijndael author's implementation) ShiftRows is implemented as usual shift and mask of 32-bit register; SubBytes and MixColumns are implemented as memory lookups (8 bit โ†’ 32 bit)
  • 33. AES effective software implementation: extra memory optimization Decreasing memory amount: single table (1 kByte instead of 4 tables of 1 kB each)
  • 34. Main table size for the fastest and compact optimized 32-bit AES implementation ๏ฌ fastest: ๏ฌ (4 bytes) x (256 different entries to S-box) x x (4 different positions for ShiftRow) == 4 kbytes ๏ฌ compact optimized: ๏ฌ (4 bytes) x (256 different entries to S-box) == == 1 kbyte ๏ฌ three additional operations in C ( << , >>, | or ^) are needed besides a table look-up NB: for reaching highest performance precomputed tables and processing data must fit into L1 processor cache (32-64kBytes for modern processors)
  • 35. Number of 32-bit operations needed for a single block encryption at main transformation (having all round keys) ๏ฌ ( (4 look-up) + (3 xors) ) * (4 columns) == == 28 operations / round ๏ฌ 4 xors with round keys == == 4 operations / round ๏ฌ (28 + 4) * (9 rounds) == 288 operations for high strength encryption of 9 rounds (!) ๏ฌ (16 operations on SubBytes) + (24 operations on ShiftRows) + (4 xors with round keys) == == 44 operations at last round
  • 37. AES decryption: optimization ๏ฌ SubBytes() and ShiftRows() transformations commute, their sequence can be chaged ๏ฌ The column mixing operations - MixColumns() and InvMixColumns() โ€“ are linear with respect to the column input, which means InvMixColumns(state xor Round Key) == InvMixColumns(state) xor InvMixColumns(Round Key)
  • 38. AES optimized decryption with changed round keys
  • 39. Additional details on AES implementation ๏ฌ two set of tables for encryption ๏ฌ main optimized set (MixColumns, ShiftRows and SubBytes) ๏ฌ separate S-box array for the last round ๏ฌ two set of tables for decryption (complexity is the same as for encryption) ๏ฌ main optimized set (InvMixColumns, InvShiftRows and InvSubBytes) ๏ฌ separate reverse S-box array for the last round NB: ECB decryption is not needed for the most block cipher modes of operation
  • 40. Conclusions ๏ฌ direct AES implementation is very slow (requires many byte operations and conditions) ๏ฌ three different round function operations can be united into the single look-up table access ๏ฌ with effective implementation AES consists of look- up table accesses and round key additions ๏ฌ the fastest version AES requires 4 kB of memory for tables, fast but compact requires 1 kB ๏ฌ fast AES decryption operation has the same speed as encryption and uses changed order of round function operations with modified round keys