Saturday, October 5, 2019

Inspecting Cryptography


Cryptography

Cryptography is the science of using mathematics to encrypt and decrypt data.Cryptography enables you to store sensitive information or transmit it across insecure networks (like the Internet) so that it cannot be read by anyone except the intended recipient.It has been used to obtain secure communication between individuals, government agencies, banking, and military forces.



Cryptosystem : Hardware or software implementation of cryptography that contains all the necessary software, protocols, algorithms, and keys

Cryptanalysis : The procedures, processes, methods, etc., used to translate or  interpret  secret writings (encrypted messages) into plaintext without known the secret key i,e a process by which an unintended receiver discovers the decryption process , and there by the plaintext.

Cryptology : The scientific study of cryptography and cryptanalys ,Cryptology -> Cryptography + Cryptanalysis

Algorithm (Cipher) : Set of mathematical and logic rules used in cryptographic functions,In Cryptography a cipher is an algorithm for performing encryption or decryption. Cipher is called as an encryption scheme.

Kerckhoffs’ principle : Concept that an algorithm should be known and only the keys should be kept secret

Encryption : The conversion of a original message , reffered to as plaintext  or cleartext , into a different message known as ciphertext (the word cipher comes from an old Arabic word meaning empty or zero), or cryptogram.

Decryption : The extraction process by which the intended receiver extracts the plaintext from ciphertext.

Cryptographic Key : A sequence of letters ,symbols or numbers rather like a password
  • Key : A piece of information that determines the functional output of a cryptographic algorithm.
  • Key clustering : Instance when two different keys generate the same ciphertext from the same plaintext using the same algorithm
  • Keyspace : A range of possible values used to construct keys
Cryptosystem Strength : The strength of an encryption method depends on
  • Algorithm
  • the secrecy of the key
  • the length of the key
  • the initialization vectors
  • How all work together
Work factor : an estimate of the effort and resources it would take an attacker to penetrate a cryptosystem

Cryptosystem Elements : The Important elements of Encryption are
  • Use an algorithm without flaws
  • Use a large key size
  • Use all possible values within the keyspaceas randomly as possible
  • Protect the actual key
Cryptosystem Services : Cryptosystems can provide the following services:
  • Confidentiality Renders the information unintelligible except by authorized entities.
  • Integrity Data has not been altered in an unauthorized manner since it was created, transmitted, or stored.
  • Authentication Verifies the identity of the user or system that created the information.
  • Authorization Upon proving identity, the individual is then provided with the key or password that will allow access to some resource.
  • Nonrepudiation Ensures that the sender cannot deny sending the message. 
Confusion vs Diffusion in Cryptography:  In cryptography, confusion and diffusion are two properties of the operation of a secure cipher.

Confusion :
  • It refers to making the relationship between the key and the cipher text as complex and as involved as possible in order to thwart attempts to discover the key i,e the relation between the cipher text and the key is masked by confusion.
  • In confusion, if one bit within the secret’s modified, most or all bits within the cipher text also will be modified.
  • Both stream cipher and block cipher uses confusion.
  • It can be achieved by a Substitution , Example : a --> b (Caesar Cipher )
Diffusion :
  • To make the statistical relationship between the plain text and cipher text as complex as possible in order to thwart attempts to discover the key i,e the relation between the cipher text and the plain text is masked by diffusion.
  • In diffusion, if one image within the plain text is modified, many or all image within the cipher text also will be modified.
  • Only block cipher uses diffusion.
  • It can be achieved by a  permutation followed by a function i,e it is possible through transportation algorithm., Example : abcd --> dacb (DES)

Randomization in Cryptography (Salts , Nonce & IV) 

Salts, nonces, and IVs are all one-time values used in cryptography that don’t need to be secret, but still lead to additional security. There are various steps in cryptography that call for the use of random numbers.Generating a nonce, initialization vector or cryptographic keying materials all require a random number. The security of basic cryptographic elements largely depends on the underlying random number generator (RNG) that was used. An RNG that is suitable for cryptographic usage is called a Cryptographically Secure Pseudo-Random Number Generator (CSPRNG). The strength of a cryptographic system depends heavily on the properties of these CSPRNGs. Depending on how the generated pseudo-random data is applied, a CSPRNG might need to exhibit some (or all) of these properties:
  •     It appears random
  •     Its value is unpredictable in advance
  •     It cannot be reliably reproduced after generation
Salts
  • In cryptography, a salt is random data that is used as an additional input to a one-way function that "hashes" data, a password or passphrase. Salts are used to safeguard passwords in storage.
  • Generally, salt is used in password-based systems and is concatenated to the front of a password before processing. Password systems often use a one-way hash function to turn a password into an “authenticator.” In the simplest such system, if there were no salt, an attacker could build a dictionary of common passwords and just look up the original password by authenticator.
  • Ex: hello ->(add salt) ->hello3ab9 -> hash function -> 39e19b234... -> store hash and salt
Nonce
  • Nonce means number used once. In cryptography, a nonce is an arbitrary number that can be used just once in a cryptographic communication. Nonces  are bits of data often input to cryptographic protocols and algorithms, including many message authentication codes and some encryption modes.
  • Such values should only be used a single time with any particular cryptographic key. In fact, reuse generally isn’t prohibited, but the odds of reuse need to be exceptionally low. That is, if you have a nonce that is very large compared to the number of times you expect to use it (e.g., the nonce is 128 bits, and you don’t expect to use it more than 232 times),it is sufficient to choose nonces using a cryptographically strong pseudo-random number generator.
IV (Initialization Vector)
  • IV values are nonce as well, as the numbers are used only once. IV’s or starting variables is a fixed size input.IV and nonce are often used interchangeably. Essentially though, an IV is a nonce with an additional requirement: it must be selected in a non-predictable way. This would eliminate all sequential nonces, an IV must be random.
  • The big downside to an IV, as compared to a nonce, is that an IV does not afford protection against capture-replay attacks—unless you’re willing to remember every IV that has ever been used, which is not a good solution. To ensure protection against such attacks when using an IV, the higher-level protocol must have its own notion of sequence numbers that get checked in order.
 Note :
  • A probabilistic encryption scheme  is an IV-based encryption scheme, in the security definition,the IV will be regarded as a random value R.
  • A nonce-based encryption scheme is an IV-based encryption scheme, in the security definition, the IV will be regarded as a nonce N : a value that is used at most once for a given key.
Ciphers
Classical
Transposition
Rail fence cipher,Route cipher,Simple columnar cipher,Keyword columnar cipher
Substitution
Monoalphabetical / Simple  ciphers
Caesar cipher,ROT13,Atbash Cipher ,Affine Cipher
Homophonic  ciphers
Book cipher
Polygraphic  ciphers
Playfair cipher,Two-square cipher,
Four-square cipher,Hill cipher
Polyalphabetical ciphers
Trithemius cipher,Vigenère cipher,Beaufort cipher,Running key cipher,Autokey cipher,Nihilist cipher,VIC cipher,One Time Pad cipher
Rotor machines
Hebern machine,Lorenz machine,Enigma
Simple XOR
Simple XOR cipher
Modern
Symmetric
Stream Cipher
ISAAC,Quad,Fish,Seal,OTP,RC4,RC5,RC6,Salsa20,CSS
Block Cipher
AES,DES,3DES,IDEA,Blowfish,Camellia,Serpent,Twofish,RC2
Asymmetric
RSA,DSA,Diffie-Hellman,ECC,El Gamal




















Encryption Schemes : There are two types of ciphers: (a) Classical Ciphers (b) Modern Ciphers
Classical Ciphers :
A classical cipher is a type of cipher that was used historically. In general, classical ciphers operate on an alphabet of letters (such as "A-Z"), and are implemented by hand or with simple mechanical devices.
  • Sender and Recipient share a same key.
  • All classical encryption & decryption algorithms are Symmetric.
  • Classical Cipher Types: Substitution Cipher,Transposition Cipher,Rotor machines, Simple XOR 
Substitution cipher :
  • It is a method of encoding by which units of plaintext are replaced with another plaintext text according to a fixed system; the "units" may be single letters (the most common), pairs of letters, triplets of letters, mixtures of the above, and so forth.
  • Used in Symmetric algorithms
  • Provides confusion to cryptanalyst 
  • Monoalphabetic cipher : uses fixed substitution (one character only)
  • Polyalphabetic cipher : uses a number of substitutions (many alphabets)
  • Polygraph cipher : a cipher that operates on larger groups of letters
  • Homophonic cipher : a cipher in which single plaintext letters can be replaced by any of several different ciphertext letters. They are generally much more difficult to break than standard substitution ciphers.
Transposition cipher :
  • A simple data encryption scheme in which plain text characters are shifted in some regular pattern to form cipher text.
  • Provides diffusion functionality
  • Scytaleis a transposition cipher. A band is wrapped around a rod, a message is written, and when the band is unrolled a ciphertext appears.
Rotor machines :
  • First electro-mechanical machines started to be used for encryption as early as at the end of the 19th century. Rotor machines, which were developed after World War I, were equipped with internal movable rotors that implemented polyalphabetic substitution ciphers.
  • The primary component is a set of rotors, also termed wheels or drums, which are rotating disks with an array of electrical contacts on either side. The wiring between the contacts implements a fixed substitution of letters, replacing them in some complex fashion. On its own, this would offer little security; however, after encrypting each letter, the rotors advance positions, changing the substitution. By this means, a rotor machine produces a complex polyalphabetic substitution cipher, which changes with every keypress.
  • Example : Hebern rotor machine, Lorenz rotor machine, Enigma 
Simple XOR :
  • It is a simple substitution cipher which operates on single bits and bytes, instead of on letters.
  • The concept of implementation is to first define XOR – encryption key and then to perform XOR operation of the characters in the String with this key which you want to encrypt. To decrypt the encrypted characters we have to perform XOR operation again with the defined key. Here we are encrypting the entire String. 
  • Example : Simple XOR cipher
Modern Ciphers : It can be Symmetric or Asymmetric “a way of changing a message to keep it secret”.

Symmetric Cryptography(Private-key cryptography)
In Symmetric Key Algorithms same key used for encryption and  decryption. Symmetric ciphers are the oldest and most used cryptographic ciphers. In a symmetric cipher, the key that deciphers the ciphertext is the same as (or can be easily derived from) the key enciphers the clear text. This key is often referred to as the secret key. The most widely used symmetric ciphers are DES and AES.
  • Both the parties share the same key
  • Key [secret key] is used for encryption/decryption
  • Each pair has to have a unique secret key
  • Number of keys = n(n-1)/2
  • Keys have to be securely shared between communicating parties
  • Examples : DES, 3DES, IDEA, Blowfish, RC4/5/6, AES

Advantage
Disadvantage
  • Extremely faster than Asymmetric Cryptography
  • Can encrypt/decrypt very large amount of data
  • Hard to break if a large key size is used
  • Requires a secure out-of-band medium to share the keys
  • As the number of parties increases, manageability of keys is a problem
  • Provides only confidentiality, not authenticity or integrity

Asymmetric Cryptography(Public-key cryptography)
In Asymmetric Key Algorithms different keys used for encryption and decryption. Unlike a symmetric cipher, an asymmetric cipher uses two keys: one key that is kept secret and known to only one person (the private key) and another key that is public and available to everyone (the public key). The two keys are mathematically interrelated, but it's impossible to derive one key from the other. Well-known asymmetric ciphers are the Diffie-Hellman algorithm, RSA, and DSA
  • Pair of keys are required for encryption/decryption
  • These keys are mathematically related 
  • Each key is used to encrypt/decrypt
  • Cannot encrypt/decrypt with only one key
  • Public key is usually shared while private key is secured by the owner
  • Secure Message format ~ message is encrypted with receiver's public key ~ Confidentiality
  • Open Message format ~ message is encrypted with sender’s private key ~ Authenticity
  • Examples : RSA, ECC,DH, El Gamal, DSA
Advantage
Disadvantage
  • Scalable
  • Provides confidentiality, authentication and non-repudiation
  • Better key distribution mechanism
  • Slower than symmetric key
  • Mathematically complex and intensive task

Advantages and disadvantages of using an asymmetric cipher instead of a symmetric cipher ?
  • An important advantage of asymmetric ciphers over symmetric ciphers is that no secret channel is necessary for the exchange of the public key. The receiver needs only to be assured of the authenticity of the public key. Symmetric ciphers require a secret channel to send the secret key—generated at one side of the communication channel—to the other side.
  • Asymmetric ciphers also create lesser key-management problems than symmetric ciphers. Only 2n keys are needed for n entities to communicate securely with one another. In a system based on symmetric ciphers, you would need n(n ? 1)/2 secret keys. In a 5000-employee organization, for example, the companywide deployment of a symmetric crypto-based security solution would require more than 12 million keys. The deployment of an asymmetric solution would require only 10,000 keys.
  • A disadvantage of asymmetric ciphers over symmetric ciphers is that they tend to be about "1000 times slower." By that, I mean that it can take about 1000 times more CPU time to process an asymmetric encryption or decryption than a symmetric encryption or decryption.
  • Another disadvantage is that symmetric ciphers can be cracked through a "brute-force" attack, in which all possible keys are attempted until the right key is found.

Attribute
Symmetric
Asymmetric
Keys
One key is shared between two or more entities
One entity has a public key and the other entity has the corresponding private key.
Key exchange
Out-of-band through secure mechanisms
A public key is made available to everyone and a private key is kept secret by the owner.
Speed
Algorithm is less complex and faster
Algorithm is more complex and slower
Use
Bulk encryptions , which means encrypting files and communication paths
Key distribution and digital signature
Secure service provided
Confidentiality
Authentication and no repudiation
Because of these characteristics, asymmetric ciphers are typically used for data authentication (through digital signatures), for the distribution of a symmetric bulk encryption key (aka a digital envelope), for non-repudiation services, and for key agreement. Symmetric ciphers are used for bulk encryption.

Hybrid Encryption Methods :
  • Use of Symmetric and Asymmetric Algorithms as complementary methods
  • Symmetric key is generally used to encrypt the message
  • Asymmetric key is used to encrypt the Symmetric key
  • This process is more commonly called as digital envelope
  • Example : PGP
Types of symmetric ciphers
There are two kinds of symmetric ciphers in modern cryptography: stream ciphers and block ciphers.

Both Block Cipher and Stream Cipher are belongs to the symmetric key cipher. These two block cipher and stream cipher are the methods used for converting the plain text into cipher text.

The main difference between Block cipher and Stream cipher is that block cipher converts the plain text into cipher text by taking plain text’s block at a time. While stream cipher converts the plain text into cipher text by taking 1 byte of plain text at a time.

Stream ciphers
Stream ciphers encrypt the digits (typically bits) of a message one at a time. Stream ciphers are based on generating a possible infinite cryptographic keystream of random data. They take one output bit (or byte) at a time, and use it to encrypt the corresponding bit (or byte) of input data.Stream ciphers work on continuous stream of plaintext data and they do not divide it into smaller blocks.
  • Each plaintext digit is encrypted one at a time with the corresponding digit of the keystream
  • The encryption of each digit is dependent on the current state ~ called State Cipher
  • Uses a keystream generator ~ produces a stream of bits that is X-ored with the plain text stream
  • It is better suited to be implemented at the hardware level
  • Example : OTP,RC4,Salsa20,CSS
Characteristics of a strong stream cipher :
  • Long periods of no repeating patterns within keystream values
  • Statistically unpredictable keystream
  • keystream not linearly related to the key
  • Statistically unbiased keystream (as many zeroes as ones)
Advantage
Disadvantage
  • Stream ciphers can encrypt and decrypt more quickly
  • Are able to scale better within increased bandwidth requirements
  • Used when real-time applications, as in VoIP or multimedia are encrypted
  • considered less secure than block ciphers
  • require a lot of randomness and encrypt individual bits at a time
  • requires more processing power than block ciphers
  • generating a truly random and unbiased keystream is difficult

Key stream generator in stream cipher (Synchronous and Asynchronous stream cipher)

Take one bit/byte/word at a time and do the encryption and decryption.Because in Stream cipher to encrypt every byte you need one byte of key material.

Example : Take one byte of key and one byte of plain text and produce one byte of cipher text.
The important thing in Stream Cipher is ,you will provide a key K , but you will not use the key directly instead you will pass this key to a Key Stream Generator(KSG).
The purpose of KSG is , if you will input a key it will provide unlimited of random key streams KS.
KS will be use finally to do an encryption.


Example : To encrypt 1 mb of file , you need 1 mb of key, but we can't provide such a big key. We can provide 128 bit key or 256 bit key. i,e suppose we have to encrypt 1 GB of data , it need 1 GB of key which is not possible.
In Stream cipher , you will take a plain text and take a key stream and do an XOR operation and will get the cipher text.  Plain text (+) key Steam = Cipher Text

Stream cipher has 2 categories : (a) Synchronous stream cipher (b) Asynchronous stream cipher

Synchronous stream cipher : Key stream is directly depending on the key, there is no other input or parameter for you.



Asynchronous stream cipher : Key Stream is depends upon the key and previous cipher text.


Example of Stream Ciphers :
  • RC4- Rivest Cipher - Very fast with both hardware and software , but not secureFor Mobile Communication , {A5/1,A5/2} used in GSM to encrypt voice traffic between cell phone and base station
  • SALSA20 (Designed by Danial J Bernstein)
  • CHACHA20 (Designed by Danial J Bernstein)
  • Hardware based stream cipher : Grain128-a , It is very fast. 
RC4 :

Designed by Ron Rivest of RSA Security in 1987 , "Rivest Cipher 4" or Ron's Code also called ARCFOUR (meaning alleged RC4) used by WEP,WPA,SSL/TLS .
It was prohibited for all versions of TLS by RFC 7465 in 2015, due to the RC4 attacks weakening or breaking RC4 used in SSL/TLS

RC4 encryption/decryption using openssl :  128 bit key size is commonly used

[java2depth@java2depth-PC ~]$  echo -n "secret" | openssl rc4 -e -K 12345678901234567890123456789012

▒▒▒=[java2depth@java2depth-PC ~]$  echo -n "secret" | openssl rc4 -e -K 12345678901234567890123456789012 | od -tx1
0000000 9b d6 19 16 b3 3d
0000006

[java2depth@java2depth-PC ~]$  echo -n "secret" | openssl rc4 -e -K 12345678901234567890123456789012 | openssl rc4 -d -K 12345678901234567890123456789012
secret[java2depth@java2depth-PC ~]$
Block ciphers
  • Plaintext is divided into blocks of data and is encrypted one block at a time
  • Most block ciphers work with 32, 64 or 128 bit block sizes
  • Uses both confusion and diffusion to strengthen the encryption process
  • Confusion is achieved via substitution and diffusion is achieved via transposition
  • The randomness of the key value and the complexity of the mathematical function determine the confusion and diffusion involved
  • Confusion pertains to making the relationship between the key and resulting ciphertext    as complex as possible so the key cannot be uncovered from the ciphertext.
  • Diffusion means that a single plaintext bit has influence over several of the ciphertext bits.
  • Avalanche effect is similar to diffusion ~ if the input to an algorithm is slightly modified then the output of the algorithm is changed significantly.
  • Block cipher algorithms are often able to combine data from different blocks in order to provide additional security (e.g. AES in CBC mode).
  • Block ciphers may be described as efficient and deterministic functions, which permute contents of all data blocks. They simply mix all the bits in each block. Permutation functions must be pseudorandom and the output should be indistinguishable from pure random data. To allow decryption, the inverse permutations must be used. The inverse permutations need also to be quite efficient.
  • Example : DES,RC2,3DES,AES,Blowfish,Camellia,Serpent,Twofish
In block cipher instead of one byte at a time , we always a bunch of data. we are calling one block of data at a time. usually the cipher will define the block size , The block size in the past was either 64 bits or 128 bits. But now a days , we are no longer using the 64 bits , we are mostly using 128 block size. If input is less than block size use padding.

Example : DES,3DES,AES,A5/3(aka KASUMI, used in 3GPP),CAMELLIA,ARIA,blowfish,twofish


Mode of Operation :

Ciphers
 Modes of Operation
Deterministic 
Unauthenticated
 Block Mode
ECB
Probabilistic
Unauthenticated
 Block Mode
CBC
 Stream Mode
OFB,CFB,CTR
Authenticated
AEAD Mode
GCM,OCB,EAX,CCM,CWC,XCBC,IAPM

Deterministic encryption : Problem in Deterministic encryption is , whenever u will provide the same input u will always get the same output with out changing the key. What ever the pattern is in input , there would be exact the same pattern in the output cipher text Encryption and Decryption can be performed using parallel algorithm. It is very first.

Example : AES256 using ECB Mode - Input statistical property will still maintain in cipher text. thats why in real life you should use Non ECB mode like CBC,CTR,GCM but not ECB mode.

Probabilistic encryption : Hiding statistical property in the plain text, Probabilistic with random value i,e IV initialization vector , which will be change . When u r using a salt with your password then it will always produce unique Key and IV and Salt is acting as a Nonce value, for the probabilistic encryption. Every time keep changing the IV.

Example :  AES using GCM, AES using CBC ,CTR (counter) mode of operation

Initialization Vector (IV) :
  • Random values that are used with algorithms to ensure patterns are not created during the encryption process.
  • They are used with keys and do not need to be encrypted when being sent to the destination
  • If IVs are not used, then two identical plaintext values that are encrypted with the same key will create the same ciphertext.
  • The IV and key are both used by the algorithm to provide more randomness to the encryption process
Electronic Code Book (ECB)
ECB encrypts each block of data independently and the same plaintext block will result in the same ciphertext block.Thus, it is possible to encrypt and decrypt by using many threads simultaneously. 
  • Message is broken into independent (64-bit) blocks which are encrypted
  • Each block is encoded independently of the other blocks (No Chaining)
  • Operations can be run in parallel, which decrease processing time
  • Errors are contained
  • Useable only for shorter messages
  • Cannot carry out pre-processing functions before receiving plain text 
ECB Encryption and Decryption :

Advantages :  Faster and Easy
Disadvantages : Repetitive information contained in the plaintext may show in the ciphertext, if aligned with blocks. If the same message is encrypted (with the same key) and sent twice, their ciphertext are the same

Cipher Block Chaining (CBC)
CBC has an IV and thus needs randomness every time a message is encrypted, changing a part of the message requires re-encrypting everything after the change, transmission errors in one ciphertext block completely destroy the plaintext and change the decryption of the next block, decryption can be parallelized / encryption can't, the plaintext is malleable to a certain degree this can be a problem.The IV has the same size as a plaintext block.
  • Solve security deficiencies in ECB, repeated same plaintext block result in different ciphertext block
  • Each previous cipher blocks is chained to be input with current plaintext block
  • The encryption of a block depends on the current and all blocks before it.
  • So, repeated plaintext blocks are encrypted differently.
  • Initialization Vector (IV) is used to encrypt the first 64-bit block to bring in randomness ,may be sent encrypted in ECB mode before the rest of ciphertext
  • Uses : bulk data encryption
CBC Encryption and Decryption :

Cipher Feedback Mode (CFB) 

CFB's pseudo random stream depends on the plaintext, a different nonce or random IV is needed for every message, like with CTR and OFB using nonces message encryption is possible without per message randomness, decryption is parallelizable / encryption is not, transmission errors completely destroy the following block, but only effect the wrong bits in the current block.
  • A ciphertext segment depends on the current and all preceding plaintext segments.
  • A corrupted ciphertext segment during transmission will affect the current and next several plaintext segments.
  • Size of the ciphertext must be the same size as the block of plaintext
  • Uses : stream data encryption, authentication
The block cipher is used as a stream cipher.
  • enable to encrypt any number of bits e.g. single bits or single characters (bytes)
  • S=1    : bit stream cipher
  • S=8    : character stream cipher
CFB Encryption and Decryption :

Output FeedBack (OFB)
OFB also creates a pseudo random stream independent of the plaintext, different pseudo random streams are obtained by starting with a different nonce or random IV for every message, neither encryption nor decryption is parallelizable, as with CTR using nonces message encryption is possible without per message randomness, as with CTR transmission errors only effect the wrong bits and nothing more.
  • Very similar to CFB
  • The block cipher is used as a stream cipher.
  • Appropriate when data arrives in bits/bytes and when error propagation is not accepted
  • Keystream need to be of the same size as the block of plaintext
  • Advantage : more resistant to transmission errors; a bit error in a ciphertext segment affects only the decryption of that segment.
  • IV should be generated randomly each time and sent with the ciphertext.
  • Uses: stream encryption over noisy channels (digital video, audio signals)
OFB Encryption and Decryption :
Counter (CTR) :
CTR is simple, it creates a pseudo random stream that is independent of the plaintext, different pseudo random streams are obtained by counting up from different nonces/IVs which are multiplied by a maximum message length so that overlap is prevented, using nonces message encryption is possible without per message randomness, decryption and encryption are completed parallelizable, transmission errors only effect the wrong bits and nothing more.
  • Uses an IV counter that increments for each plaintext block that needs to be encrypted
  • Counter for each plaintext will be different : can be any function which produces a sequence which is guaranteed not to repeat for a long time
  • Strengths : Needs only the encryption algorithm ,Random access to encrypted data blocks , blocks can be processed (encrypted or decrypted) in parallel, Simple; fast encryption/decryption
  • Counter must be , unknown and unpredictable
  • Uses : high-speed network encryptions, Encrypting ATM cells, IPSec, Wireless 802.11i
 CTR Encryption and Decryption :



 Comparison of Modes :

Mode
Description
Application
ECB 64-bit plaintext block encoded separately Secure transmission of encryption key
CBC 64-bit plaintext blocks are XOR with preceding 64-bit cipher text Commonly used method. Used for authentication
CFB s bits are processed at a time and used similar to CBC Primary stream cipher. Used for authentication
OFB Similar to CFB except that the output is not fed back Stream cipher well suited for transmission over noisy channels
CTR Key calculated using the nonce and the counter value. Counter is incremented for each block General purpose block oriented transmission. Used for high-speed communications
CCMP Counter mode with CBC-MAC protocol based on AES encryption using CTR with CBC-MAC Component of 802.11i wireless standard

Remark on each Mode :
  • ECB should not be used if encrypting more than one block of data with the same key.
  • CBC is an excellent block cipher
  • CFB, OFB, and CTR are stream ciphers
  • CTR is faster because simpler and it allows parallel processing instead of CBC/OFB/CFB
  • CBC and CFB : Reusing an IV leaks some information about the first block of plaintext, and about any common prefix shared by the two messages
  • OFB and CTR : Reusing an IV completely destroys security
  • Stream ciphers are considered Synchronous cryptosystems
  • Block Chain ciphers are considered Asynchronous cryptosystems
  • CTR component in CCMP provides data privacy
  • In CCMP MAC provides data origin authentication and data integrity for the packet payload
  • XTS mode is the most common if you are encoding a random accessible data (like a hard disk or RAM)
  • OCB is by far the best mode, as it allows encryption and authentication in a single pass. However there are patents on it in USA.
Note : 
  • The only thing you really have to know is that ECB is not to be used unless you are only encrypting 1 block. XTS should be used if you are encrypting randomly accessed data and not a stream.
  • You should ALWAYS use unique IV's every time you encrypt, and they should be random. If you cannot guarantee they are random, use OCB as it only requires a nonce, not an IV, and there is a distinct difference. A nonce does not drop security if people can guess the next one, an IV can cause this problem.
  •  If the data is authenticated by an asymmetric signature use CBC, otherwise use GCM.

DES : 
  • On 1960, The input plain text was always 64 bits , where as the key was 128 bits. 
  • On 1990, NSA diff cryptanalysis has suggested to changes the key size from 128 to 56 bits due to some reason.
  • Finally they kept the plain text size was 64 bits , but key size was changed to 56 bits instead of 64 bits.It does not handle the 128 bits blocks, later it was changed to 56 bits block.
  • FIPS 46 PUB published for the DES.From 1977 to 2005, it was survive for a long time and no attack was found. 
  • But later no one used this DES.On 1999, have a proposal to replace the DES with AES from the competition (AES has selected for the algorithm) . It was for 30 years , after that AES was came.
Triple DES :
  • In 3DES, DES has used 3 times with 3 different key. DES-K3[DES-K2[DES-K1(P)]]
  • This algorithm is providing 4 bit security i,e 2(4)=2*2*2*2 = 16 steps
  • A brutefroce attacks found with DES , hence no one using it.
Key Ring 1 -  In 3 DES 56 *3 = 168 bits key (if k1!=K2!=K3)
Key Ring 2 -  In 3 DES 56 *2 = 112 bits key (if k1!=K2)
Key Ring 3 -  Key Ring 56 *1 = 108 bits key

Kerchoff rule in cryptography - Security must be only depend upon the key , not with algorithm.

Note :
  • It was taking input as 64 bits plain text and 56 bits keys and provide output as 64 bits cipher text.The DES security was also totally broken around 2005, U can tried bruitforce attacke by trying all possible keys i,e  maximum 2*(56) keys with dedicated hardware.
  • Encryption is typically in stream cipher is implemented using XOR operation i,e it is always take one byte of plain text and one byte of key and produce cipher text.
  • Similarly in block cipher , it's so called one to one mapping called as permutation. i,encryption in block cipher can be achieved through permutation, but we can't use any permutation, need a secure permutation.
Secure Permutation :
  • Permutation is always determined by the key i,e Permutation->key , where permutation only depend on the key i,e key will produce the permutation i,e if the key will change from K1 to K2 , automatically it will change the mapping
  • Different keys should resulting different permutation i,e Diff, permutation -> Diff Key
  • Permutation should look random.
In block cipher , you need a function which can produce a secure permutation. Secure permutation alone is not enough , In order to handle the message of any length which does not strictly fall into multiple blocks.The purpose of Mode of operation is to handle the message of any length and handle multiple blocks in secure and efficient way.Secure permutation is not alone provide you encryption in practice , if you have an arbitrary message length , you need the help of mode of operation as well. So secure permutation with the combination of mode of operation , essentially we can implement a block cipher in real life in practice.

In American government they created the standard DES,3DES and AES , DES is broken , but 3DES theoretical attack exist. In Soveit Union USSR,GOST (Magma) - 256 BS, 128 BS - Kuszayechik,Japan - Camellia (AES), South Koria - ARIA(AES)

AES
  • When a theoretical attack has started on DES, NIST in UAS , they announced for the replacement if Designed
  • AES has taken 128 bits plain text and key size of (128/192/256) and provide the output of 128 bits of cipher text.
  • Secure Permutation + Mode of Operation = Block Cipher
Authenticated Encryption With Associated Data (AEAD)

  • Authenticated encryption (AE) and authenticated encryption with associated data (AEAD) are forms of encryption which simultaneously assure the confidentiality and authenticity of data
  • The need for AE emerged from the observation that securely combining separate confidentiality and authentication block cipher operation modes could be error prone and difficult.[1][2] This was confirmed by a number of practical attacks introduced into production protocols and applications by incorrect implementation, or lack of authentication (including SSL/TLS)
  • CCM mode,CWC mode,OCB mode,EAX mode,GCM,SGCM,Signcryption 
CCM: A nonce-based AEAD scheme that combines CTR mode encryption and the raw CBC-MAC. Inherently serial, limiting speed in some contexts. Provably secure, with good bounds, assuming the underlying blockcipher is a good PRP. Ungainly construction that demonstrably does the job. Simpler to implement than GCM. Can be used as a nonce-based MAC. Widely standardized and used.

GCM: A nonce-based AEAD scheme that combines CTR mode encryption and a GF(2128)-based universal hash function. Good efficiency characteristics for some implementation environments. Good provably-secure results assuming minimal tag truncation. Attacks and poor provable-security bounds in the presence of substantial tag truncation. Can be used as a nonce-based MAC, which is then called GMAC. Questionable choice to allow nonces other than 96-bits. Recommend restricting nonces to 96-bits and tags to at least 96 bits. Widely standardized and used.


[java2depth@java2depth-PC ~]$ echo -n "a" | openssl enc -des-ecb -e -K 1234567890abcdef | od -tx1
0000000 d0 43 13 e4 ea df c4 0e
0000010

[java2depth@java2depth-PC ~]$ echo -n "a" | openssl enc -des-ecb -e -K 1234567890abcd | od -tx1
hex string is too short, padding with zero bytes to length
0000000 de a4 a5 fd 9a 47 44 8a
0000010

[java2depth@java2depth-PC ~]$ echo -n "a" | openssl enc -des-ecb -e -K 1234567890abcd -P
hex string is too short, padding with zero bytes to length
salt=3E8B086FA0330020
key=1234567890ABCD00

Change Key , Still cipher is same ? - Why ?

In DES , Key size = 56 bits -> 8*7 , bit -> 8 * 8 = 64 bit
Every 8 bit is a parity bit, Internally it first throw away 8th bit , i,e 8,16,24,32,40,48,56,86
Odd Parity : 1111 111 -> 1111 1110
Even parity : 1111 110 -> 1111 1101
FE -> 1111 1110 , FF -> 1111 1111

[java2depth@java2depth-PC ~]$ echo -n "a" | openssl enc -des-ecb -e -K FEFEFEFEFEFEFEFE | od -tx1
0000000 2f 53 9a 56 d3 0d 4c 69
0000010

[java2depth@java2depth-PC ~]$ echo -n "a" | openssl enc -des-ecb -e -K FEFEFEFEFEFEFEFF | od -tx1
0000000 2f 53 9a 56 d3 0d 4c 69
0000010

[java2depth@java2depth-PC ~]$ echo -n "a" | openssl enc -des-ecb -e -K FEFEFEFEFFFFFFFF | od -tx1
0000000 2f 53 9a 56 d3 0d 4c 69
0000010

[java2depth@java2depth-PC ~]$  echo -n "a" | openssl enc -des-ecb -e -K FEFEFEFEFEFEFFFF | openssl enc -des-ecb -d -K FEFEFEFEFEFEFFFF
a

[java2depth@java2depth-PC ~]$  echo -n "a" | openssl enc -des-ecb -e -K FEFEFEFEFEFEFFFF | openssl enc -des-ecb -d -K FEFEFEFEFEFEFFFF
a

Understood Deterministic Encryption :
  • Every time it will always give the same out put without changing the key i,e Deterministic encryption.
  • Logic using in padding bit - PKCS Public Key Cryptography Standard - RSA Security Provider
  • PKCS#1,PKCS#2,PKCS#3,PKCS#4 ----,PKCS#7
7 bytes -> 7 + 1 = 0x01
6 bytes -> 6 + 2 = 0x02 02
5 bytes -> 5 + 3 = 0x03 03 03
.
.
1 bytes -> 1 + 7 = 0x07 07 07 07 07 07 07
8 bytes [BS] + 0 = 0x08 08 08 08 08 08 08 08

Note : For 8 bits , it will also added the padding

Example of ECB Modes :

[java2depth@java2depth-PC ~]$ echo -n "a" | openssl enc -des-ecb -e -K FEFEFEFEFEFFFFFF | od -tx1
0000000 2f 53 9a 56 d3 0d 4c 69
0000010

[java2depth@java2depth-PC ~]$ echo -n "1234567" | openssl enc -des-ecb -e -K FEFEFEFEFEFFFFFF | od -tx1
0000000 cb 08 fe 2e 53 6b 7b eb
0000010

[java2depth@java2depth-PC ~]$ echo -n "12345678" | openssl enc -des-ecb -e -K FEFEFEFEFEFFFFFF | od -tx1
0000000 fd fa 8e a5 45 55 a5 e4 6a ec 3f 62 f4 60 a0 8d
0000020

Example of CBC Modes :

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des-cbc -e -iv 1234567890abcdef -K 1234567890abcdef -P
salt=3E8B086FA0330020
key=1234567890ABCDEF
iv =1234567890ABCDEF

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des-cbc -e -iv 1234567890abcdef -K 1234567890abcdef | od -tx1
0000000 df b5 45 05 0b f8 0f ab
0000010

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des-cbc -e -iv 1234567890abcdef -K 1234567890abcdef |  openssl enc -des-cbc -d -iv 1234567890abcdef -K 1234567890abcdef
secret

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des-cbc -e -iv 1234567890abcdef -K 1234567890abcdef | od -tx1
0000000 df b5 45 05 0b f8 0f ab
0000010

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des-cbc -e -iv 1234567890abcd00 -K 1234567890abcdef | od -tx1
0000000 14 58 6b 6f c5 ba 3a 3f
0000010

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des-cbc -e -iv 1234567890abcd01 -K 1234567890abcdef | od -tx1
0000000 46 b4 93 ef 1f e6 67 01
0000010

CTR (counter) Mode of Operation :

IV = (N||CTR) , where N= Nonce  and Key stream will be same , if we will use the same IV, thats why counter will increment for the next IV.
In AES , BS=128, (96||32) = 128 , C1 = P1 + KS and C2 = P2 + KS

Note : Here the actual encryption of plain text is happening using XOR operation, your encryption is not happening using AES.that means when u will use counter mode , It will automatically tens from AES to Stream cipher i,e using XOR operation . Basically the Block Cipher is used to generate the Key Stream. Here we are converting a block cipher to stream cipher. Affective encryption is  happening actually through a stream cipher.

Example : 

  • CTR ->GCM (Galois) i,e  AES-GCM 
  • CCMP (Counter Mode CBC MAC) i,e AES - CCM
  • Operation used in popular website that use HTTPS i,e https://www.google.co.in/ , https://www.online.citibank.co.in/ , https://www.iitm.ac.in/ 



Key differences between Stream ciphers and Block Ciphers:
  • Block cipher technique involves encryption of one block of text at a time, i.e. singly. Similarly, decrypt the text by taking one block after another. In contrast, Stream cipher technique involves encryption and decryption of one byte of the text at a time.
  • Block cipher uses both confusion and diffusion while stream cipher relies only on confusion.
  • The usual size of the block could be 64 or 128 bits in the Block cipher. As against, 1 byte (8 bits) at a time is converted in the stream cipher.
  • Block cipher uses ECB (Electronic Code Book) and CBC (Cipher Block Chaining) algorithm modes.
  •  On the contrary, Stream cipher uses CFB (Cipher Feedback) and OFB (Output Feedback)algorithm modes.
  • Stream cipher uses XOR function for converting the plain text into cipher text, that is the reason why it is easy to reverse the XORed bits. Whereas Block cipher does not use XOR for doing so.
  • Block cipher uses the same key to encrypt each block while stream cipher uses a different key for each byte.
Password Base Key Derivation Function (PBKDF)

Openssl is automatically generate key and iv for us ,For this there is a special algorithm called Password based key derivation function (PBKDF) , This function take password as an input and generate a random output.  Advanced version is : PBKDF2
  • PBKDF2(hashing algorithm, password,salt,number of iteration,no of output values)
  • PBKDF2('sha256','password','salt',4096)
When u r using a salt with your password , then it will always produce unique Key and IV. Salt is acting as a Nonce value, for the probabilistic encryption.
-P : Don't do encryption , what is the key and IV value are being used , can you please show in my console.

[java2depth@java2depth-PC ~]$  echo -n "secret" | openssl enc -des -e -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=FFD94D8D871FE543
key=16921D4FB504F543
iv =166FB767BB3238B7

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des -e -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=82D71F439C9062C2
key=5C2155B2DDC0B3F0
iv =4AA9E2797385F748

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des -e -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=C472CFA2B6A18A65
key=C5566BC0E9DAF93B
iv =05BAB1D9105FAF7E

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -des -e -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=E639B8B28C72BDB6
key=E894DCA59325E217
iv =E3FF1C251E3A432D

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des3 -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=51A3897CE2023EB3
key=CBE157EF513F8141F20341881F9A07B1A359D9159B7168AF
iv =9CBAC3B0D445ED32

Key Length = 64 * 4 = 192

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des3 -k apple -a
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
U2FsdGVkX1/ZYqbCi/E15OIZ2c1J+/So

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des3 -k apple -a | openssl enc -d -des3 -k apple -a
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
secret

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des-ede-cbc -k apple -a
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
U2FsdGVkX19TmO+YaxM6D/rNg27/trj3

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des-ede-cbc -k apple -a | openssl enc -d -des-ede-cbc -k apple -a
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
secret

Note :
Salt Value = Block Size and IV = Key Block Size

With Out salt : (If you will not use salt , then you will always end up with same key and IV) , so u have to always use salt with your password.
[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des-ede-cbc -k apple -nosalt -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
key=3A7BD3E2360A3D29EEA436FCFB7E44C7
iv =35D117C42D1C1835

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des-ede-cbc -k apple -nosalt -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
key=3A7BD3E2360A3D29EEA436FCFB7E44C7
iv =35D117C42D1C1835

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des-ede-cbc -k apple -nosalt -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
key=3A7BD3E2360A3D29EEA436FCFB7E44C7
iv =35D117C42D1C1835 

Explicitly Use salt :

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des-ede-cbc -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=6EB3CC7E2650D4B9
key=69C9FC1CB794E4E65D8B590301B353F7
iv =FA1433FE5D8C0205

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -des-ede-cbc -k apple -S 6EB3CC7E2650D4B9 -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=6EB3CC7E2650D4B9
key=69C9FC1CB794E4E65D8B590301B353F7
iv =FA1433FE5D8C0205

AES , BS = 128 bit, KS (128,192,256)

[java2depth@java2depth-PC ~]$  echo -n "secret" | openssl enc -e -aes128 -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=B6A0BC08C90ED803
key=084E9DD9C56DBC517AF4F292037DE561
iv =227D32C1C2881F8119E6AD9BA1D0124C

[java2depth@java2depth-PC ~]$  echo -n "secret" | openssl enc -e -aes192 -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=82B9CD6C5A6EEA5B
key=90D9A975AF2DD1465D1F8A616805BDDEB2C732FE34367D66
iv =21A271ACF5AFA24EEF50FD91A5DBE38A

[java2depth@java2depth-PC ~]$  echo -n "secret" | openssl enc -e -aes256 -k apple -P
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=12A6B809800A4082
key=D5A62255866C8B615DDAA9E7D29B4B9C7B1B90E54FC92F2E87AECEECAE26F3CD
iv =327D199D6DFD5F6C140B20E58C328744

[java2depth@java2depth-PC ~]$ echo -n "secret" | openssl enc -e -aes256 -k apple -a
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
U2FsdGVkX18ib1jt0LjS5SrxA1vQKsw4d1pdngid3nI=

[java2depth@java2depth-PC ~]$  echo -n "secret" | openssl enc -e -aes256 -k apple | openssl enc -d  -aes256 -k apple
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
secret

[java2depth@java2depth-PC ~]$ openssl s_client -connect f5.com:443
CONNECTED(00000004)
depth=2 C = US, O = "Entrust, Inc.", OU = See www.entrust.net/legal-terms, OU = "(c) 2009 Entrust, Inc. - for authorized use only", CN = Entrust Root Certification Authority - G2
verify return:1
depth=1 C = US, O = "Entrust, Inc.", OU = See www.entrust.net/legal-terms, OU = "(c) 2014 Entrust, Inc. - for authorized use only", CN = Entrust Certification Authority - L1M
verify return:1
depth=0 C = US, ST = Washington, L = Seattle, jurisdictionC = US, jurisdictionST = Washington, O = F5 Networks Inc, businessCategory = Private Organization, serialNumber = 601692492, CN = f5.com
verify return:1
---
Certificate chain
 0 s:C = US, ST = Washington, L = Seattle, jurisdictionC = US, jurisdictionST = Washington, O = F5 Networks Inc, businessCategory = Private Organization, serialNumber = 601692492, CN = f5.com
   i:C = US, O = "Entrust, Inc.", OU = See www.entrust.net/legal-terms, OU = "(c) 2014 Entrust, Inc. - for authorized use only", CN = Entrust Certification Authority - L1M
 1 s:C = US, O = "Entrust, Inc.", OU = See www.entrust.net/legal-terms, OU = "(c) 2014 Entrust, Inc. - for authorized use only", CN = Entrust Certification Authority - L1M
   i:C = US, O = "Entrust, Inc.", OU = See www.entrust.net/legal-terms, OU = "(c) 2009 Entrust, Inc. - for authorized use only", CN = Entrust Root Certification Authority - G2
 2 s:C = US, O = "Entrust, Inc.", OU = See www.entrust.net/legal-terms, OU = "(c) 2009 Entrust, Inc. - for authorized use only", CN = Entrust Root Certification Authority - G2
   i:C = US, O = "Entrust, Inc.", OU = www.entrust.net/CPS is incorporated by reference, OU = "(c) 2006 Entrust, Inc.", CN = Entrust Root Certification Authority
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIH1jCCBr6gAwIBAgIRAMMAme8iko4AAAAAAFTOro4wDQYJKoZIhvcNAQELBQAw
gboxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL
Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg
MjAxNCBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAs
BgNVBAMTJUVudHJ1c3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMU0wHhcN
MTgwNzA1MTY1NDAwWhcNMjAwNzI4MTcyMzU4WjCBxDELMAkGA1UEBhMCVVMxEzAR
BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxEzARBgsrBgEEAYI3
PAIBAxMCVVMxGzAZBgsrBgEEAYI3PAIBAhMKV2FzaGluZ3RvbjEYMBYGA1UEChMP
RjUgTmV0d29ya3MgSW5jMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjES
MBAGA1UEBRMJNjAxNjkyNDkyMQ8wDQYDVQQDEwZmNS5jb20wggEiMA0GCSqGSIb3
DQEBAQUAA4IBDwAwggEKAoIBAQC73XXvZLbVBmWVV4Sw94vJN6o9gF6GAwHDWIQz
DPVJwAXuuH0lszykZyHUSeqe0M+G+c/vtsvBMJcHfaWLyJRqfAzrYFS6jADo9YAZ
NgrbQdylpLHIlQF0JAnBReBGw1+ewcLdD8yTHC07hTQ3K3FkrFOlPfjKCCjeChWD
mSx1SME5ZGwaHP55ST0daNMS11gjtH11IXKVF9Utmro+irijL0ZJ8wxV2eEso8m2
4nv8RnoQlu8xbapQCXoyAG58PHD3pbPl5500d7ZUgKSebgRw+Zj/IZV0mZUayfow
Z22PX+iBjTXSUK5VKqSEvL+M3TQ1qCwWU9V2uI1Wb4RwjQbJAgMBAAGjggPJMIID
xTBkBgNVHREEXTBbggZmNS5jb22CEWRldmNlbnRyYWwuZjUuY29tghBzeW50aGVz
aXMuZjUuY29tgg5wYXJ0bmVyLmY1LmNvbYIPcGFydG5lcnMuZjUuY29tggtsYWJz
LmY1LmNvbTCCAfYGCisGAQQB1nkCBAIEggHmBIIB4gHgAHcAVYHUwhaQNgFK6gub
VzxT8MDkOHhwJQgXL6OqHQcT0wwAAAFka3jfxAAABAMASDBGAiEAm/sujBx1rU66
nVOnu/qAn/NJmUb1vB3wacD7KzUbSrYCIQDb9a1MErc23fdbVvARANDB4ul9sMpn
XUlj3zedkQreSgB2AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM227L7MAAAB
ZGt4368AAAQDAEcwRQIgXWiuH5dAKn3os+YYuvx4y9kMou4MGZI7JpLyQHfsBQgC
IQCKrpYz6Ijuv9lIOmYJAz+NvVI2rFFTRHBBCnbSWNRgBwB1AFYUBpov18Ls0/Xh
vUSyPsdGdrm8mRFcwO+UmFXWidDdAAABZGt44AUAAAQDAEYwRAIgUl7hdQeaIoGq
nmPXtvwgdvVAIOENnQJFenmzy3CekIwCIGIkAWAcXTZGDIqqXgd5bmbhuxOKajPp
3WkWketJ+0SfAHYAu9nfvB+KcbWTlCOXqpJ7RzhXlQqrUugakJZkNo4e0YUAAAFk
a3jf0wAABAMARzBFAiBwx67nVhdjzJ9gaO05SQrxWhSHfoxyYkBSA32C5vPeMQIh
AIi8815Dnj53ThmsjudUA0+5Fk0sKHo97mcd4tUpsugiMA4GA1UdDwEB/wQEAwIF
oDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwaAYIKwYBBQUHAQEEXDBa
MCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5lbnRydXN0Lm5ldDAzBggrBgEFBQcw
AoYnaHR0cDovL2FpYS5lbnRydXN0Lm5ldC9sMW0tY2hhaW4yNTYuY2VyMDMGA1Ud
HwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvbGV2ZWwxbS5jcmww
SgYDVR0gBEMwQTA2BgpghkgBhvpsCgECMCgwJgYIKwYBBQUHAgEWGmh0dHA6Ly93
d3cuZW50cnVzdC5uZXQvcnBhMAcGBWeBDAEBMB8GA1UdIwQYMBaAFMP30LUqMK2v
DZEhcDlU3byJcMc6MB0GA1UdDgQWBBRdlqz7VXj2KZ0UDp/iUyCareCbOjAJBgNV
HRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAaPfUQKWIr1ern/4iqL74fgGyI6wLZ
bTrgcNS2VrLPQDQ6n45AY/D6G5dtG8WwC+zptiFWnCf5E7bFS08fojRyZn4/LSvZ
kQBuydZEkMFpLO/icYmZe6MJQ0nCqsXbqMQPMdhspoyQR7bnicgn2vNp+87LwBT2
nGNQxaZ7zoX9EpHKTQg29iQ/tU9AtDqE/mzznsCDSp7kPp/71nqVOn8rasjCDNRI
JMpxTmUurCOmSDGowykIdkBKkqSAiE3C89gh1HwPWLAHeDEn7kc4CRvqXpAIDCI3
mAzJT+LNF2TgKEkug62ExFlCCsqz0PyJN14iEue3zWllT+RsGZ3Hla51
-----END CERTIFICATE-----
subject=C = US, ST = Washington, L = Seattle, jurisdictionC = US, jurisdictionST = Washington, O = F5 Networks Inc, businessCategory = Private Organization, serialNumber = 601692492, CN = f5.com

issuer=C = US, O = "Entrust, Inc.", OU = See www.entrust.net/legal-terms, OU = "(c) 2014 Entrust, Inc. - for authorized use only", CN = Entrust Certification Authority - L1M

---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 5137 bytes and written 444 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: 56BCF9F6EA40AC1BBE04432ED309D4228AD5B69CDBC206B03151FDD2A2992433
    Session-ID-ctx:
    Master-Key: B46954432F11777A00F3D3FD4371FE9CD91F1346A000DEEC20519E4BB61EA85C91D658B9ABE3BEF0704BF0BDC90B7CB2
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1561179825
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: yes
--- 
Cipher Type
Algorithim
SunJCE
Supported
Default
Key Length
Block Size
Supported Key Size
Number
of Rounds
Symmetric
DES
Yes
56 bits
64 bits
56 bits
16
AES
Yes
Variable
128 bits
128,192 or 256 bits
10,12,14
RC2, RC4 , RC5 and RC6
Yes
Variable
8,16,32,
64,128bits
0 - 2048 bits
20-256
IDEA
Yes
128 bits
64 bits
128 bits
8
Triple DES
Yes
112 bits
64 bits
56 bits,112 bits(2 key),168 bits(3key)
48
Blowfish
Yes
128 bits
64 bits
32 - 448 bits
16
Camellia
No
Variable
128 bits
128, 192 or 256 bits
18 or 24
Serpent
No
Variable
128 bits
128, 192 or 256 bits
32
Twofish
No
Variable
128 bits
128, 192 or 256 bits
16
Asymmetric
RSA
Yes
Variable
NA
1024,2048,3072,...
1
Diffie-Hellman
Yes
Variable
NA
1024,2048,3072,...
NA
ECC
No
Variable
NA
160,224,256,384,..
NA
DSA
No
Variable
NA
1024,2048,3072,...
NA
El Gamal
No
Variable
NA
160,...
NA
Hashing /
 Message Digest
MD5
Yes
64 bytes
 512 bits
Digest : 128 bits
 4
SHA1
Yes
64 bytes
 512 bits
Digest : 160 bits
 4(3)

No comments:

Post a Comment