Ins Overview
Ins Overview
Ins Overview
• PKE uses public and private key for encryption and decryption.
• In this mechanism, public key is used to encrypt the message and
only the corresponding private key can be used to decrypt those
messages.
• To encrypt a message, the sender has to know the recipient’s
public key.
Hash Functions
• a hash function is a function used to map an arbitrary sized data
into a fixed size data.
• values returned by hash function are called : hash values, hash
sums, hash codes or hashes.
• one use is a data structure called hash table (widely used in
software engineering for rapid data lookup).
• A cryptographic hash function is used to verify if the given input
data maps to a given hash value.
• But if if the hash algorithm is not known, it is nearly impossible to
reconstruct the input from the generated hash values.
Software Forensics
• It is the science of analysing software source code or binary code to
determine whether intellectual property infringement or theft
occurred.
• It is the center-piece of lawsuits, trials and settlements when
companies are in dispute over issues involving software patents,
copyrights and trade secrets.
• SF can compare code to determine correlation between softwares.
Linear Cryptanalysis
• it is a technique based on finding linear approximations to describe
the transformations performed in a block cipher.
Differential Cryptanalysis
• it is a general form of cryptanalysis that is applicable primarily to
block ciphers, but also to stream ciphers and cryptographic hash
functions.
• it is a technique in which chosen plain-texts with particular XOR
difference patterns are encrypted.
• it is the study of how differences in information input can affect the
resultant differences at the output.
• in case of block cipher → it refers to a set of techniques for tracing
differences through the network of transformations → discovering
where the cipher exhibits non-random behaviour → and exploiting
such properties to recover the secret key.
• the difference patterns of the resulting cipher-text provides
information that can be used to determine the encryption key.
Problems with differential cryptanalysis:
• For any particular cipher, the input differences must be carefully
selected for the attack to be successful.
• Since differential cryptanalysis has become public knowledge, it has
become a basic concern for cipher designers.
Crypto-system
• A crypto-system is an implementation of cryptographic techniques
and their accompanying infrastructure to provide information
security services. A crypto-system is also referred to as a cipher
system.
• Let us discuss a simple model of a crypto-system that provides
confidentiality to the information being transmitted. This basic
model is depicted in the illustration below −
cryptosystem illustration
Components of a Crypto-system
• Plaintext. It is the data to be protected during transmission.
• Encryption Algorithm. It is a mathematical process that produces a
cipher-text for any given plaintext and encryption key. It is a
cryptographic algorithm that takes plaintext and an encryption key
as input and produces a cipher-text.
• Cipher-text. It is the scrambled version of the plaintext produced by
the encryption algorithm using a specific the encryption key. The
cipher-text is not guarded. It flows on public channel. It can be
intercepted or compromised by anyone who has access to the
communication channel.
• Decryption Algorithm, It is a mathematical process, that produces a
unique plaintext for any given cipher-text and decryption key. It is a
cryptographic algorithm that takes a cipher-text and a decryption
key as input, and outputs a plaintext. The decryption algorithm
essentially reverses the encryption algorithm and is thus closely
related to it.
• Encryption Key. It is a value that is known to the sender. The sender
inputs the encryption key into the encryption algorithm along with
the plaintext in order to compute the cipher-text.
• Decryption Key. It is a value that is known to the receiver. The
decryption key is related to the encryption key, but is not always
identical to it. The receiver inputs the decryption key into the
decryption algorithm along with the cipher-text in order to compute
the plaintext.
Types Of Crypto-Systems
• Fundamentally, there are two types of crypto-systems based on the
manner in which encryption-decryption is carried out in the system
−
• Symmetric Key Encryption
• Asymmetric Key Encryption
The main difference between these crypto-systems is the relationship
between the encryption and the decryption key. Logically, in any crypto-
system, both the keys are closely associated. It is practically impossible to
decrypt the cipher-text with the key that is unrelated to the encryption
key.
PGP
• Pretty Good Privacy or PGP is a popular program used to encrypt
and decrypt email over the Internet, as well as authenticate
messages with digital signatures and encrypted stored files.
• Pretty Good Privacy uses a variation of the public key system. In this
system, each user has an encryption key that is publicly known and
a private key that is known only to that user. You encrypt a message
you send to someone else using their public key.
• When they receive it, they decrypt it using their private key. Since
encrypting an entire message can be time-consuming, PGP uses a
faster encryption algorithm to encrypt the message and then uses
the public key to encrypt the shorter key that was used to encrypt
the entire message.
• Both the encrypted message and the short key are sent to the
receiver who first uses the receiver’s private key to decrypt the
short key and then uses that key to decrypt the message.
• PGP comes in two public key versions — Rivest-Shamir-Adleman
(RSA) and Diffie-Hellman. The RSA version, for which PGP must pay
a license fee to RSA, uses the IDEA algorithm to generate a short key
for the entire message and RSA to encrypt the short key.
• The Diffie-Hellman version uses the CAST algorithm for the short key
to encrypt the message and the Diffie-Hellman algorithm to encrypt
the short key.
Digital Signature
• It is a mathematical technique used to validate authenticity and
integrity of a message, software or a digital document and uses
encryption techniques to provide proof of original and unmodified
documentation.
• DS are used in e-commerce, software distribution, financial
transactions and other situations that rely on forgery or tampering
detection techniques.
• A DS is also known as an electronic signature.
A DS is applied and verified as follows:
• The document or message sender → signer, or public/private key
supplier shares the public key with the end user / recipient.
• The sender, using his private key, appends the encrypted signature
to the message document.
• The end user decrypts the document and verifies the signature,
which lets the end user know that the document is from the original
sender.
Kerberos
• It is a network authentication protocol.
• Designed to provide strong authentication to client/server
applications by using secret-key cryptography.
• Kerberos requests an encrypted ticket via an authenticated server
sequence to use services.
• Was created by MIT as a solution to network security issues.
• Kerberos protocol uses strong cryptography so that a client can
prove it’s identity to a server, & vice versa, across an insecure
network connection.
• After the client & server have used Kerberos to prove their identity
→ they can also encrypt all their communications to assure privacy
& data integrity as they go about their business.
• There are two versions of Kerberos: 4 & 5
• Version 4 makes use of DES
S/MIME
• Secure / Multipurpose Internet Mail Extensions
• A technology that allows you to encrypt your emails.
• It is based on asymmetric cryptography to protect your emails from
unwanted access.
• Also allows you to digitally sign your emails to verify you as the
legitimate sender of the message → making it an effective weapon
against many phishing attacks over the internet.
• It incorporates three public key algorithms: DSS for digital
signatures, Diffie-Hellman for encrypting session keys, or RSA.
• It uses SHA1 or MD5 for calculation digests, and 3-key triple DES
for message encryption.
• Ideally, a S/MIME sender has a list of preferred decrypting
capabilities from the intended recipient, in which case it chooses
the best encryption.
• Else if the sender has received any previous mail from the intended
recipient, it then chooses the same encryption mechanism.
Phishing
• A type of Social Engineering Attack
• Often used to steal user data like login credentials and credit card
numbers.
• It occurs when an attacker is masquerading as a trusted entity,
fools a victim into opening a mail, message, etc.
• The recipient is tricked into clicking the malicious link, that can lead
to installation of malware, freezing the system as part of a
ransomware or the revealing of sensitive information.
• It is a cyber crime.
SQL Injection
• Also known as SQLI
• A common attack in which malicious SQL code is used for backend
database manipulation which is done to access information that
was not intended to be displayed.
• This information can include: any number of items, including
sensitive company data, private consumer details, etc.
• A successful attack results in → unauthorised viewing of user data,
deletion of entire tables, and in some cases, the attacker gains
admin rights to a database.
DNS Spoofing
• A type of computer attack in which a user is forced to navigate to a
fake website disguised to look like a real one, with the intention of
diverting traffic from original website or to steal credentials from
the user.
• It is done by replacing the IP addresses stored in the DNS server
with the ones under control of the attacker.
• Two ways by which DNS spoofing is carried out: DNS cache
poisoningand DNS ID spoofing.
PKC
• A public key certificate contains a public key and other information.
• It is created by a certificate authority and is given to a participant
with the matching private key.
• A participant conveys its key information to another by transmitting
its certificate → other participants can verify that the certificate was
created by the authority.
IPSec
• It is an Internet Engineering Task Force (IETF) standard suite of
protocols between 2 communication points across the IP network
that provide data authentication, integrity, and confidentiality. It
also defines the encrypted, decrypted and authenticated packets.
The protocols needed for secure key exchange and key
management are defined in it.
• Uses of IPSec:
• To encrypt application layer data.
• To provide security for routers sending routing data across the
public internet.
• To provide authentication without encryption, like to authenticate
that the data originates from a known sender.
• To protect network data by setting up circuits using IPsec tunnelling
in which all data is being sent between the two endpoints is
encrypted, as with a Virtual Private Network(VPN) connection.
Circuit-Level Gateway
• It does not permit an end-to-end TCP connection.
• Instead, this gateway sets up two TCP connections → one between
itself and a TCP user on the inner host, and a TCP user on an outside
host.
• Once the two connections are established, the gateway typically
relays TCP segments from one connection to another without
examining the contents.
Types of IPS
IPS systems can be classified into four different types:
• NIPS (network-based intruder prevention system) → monitors
entire network for suspicious traffic by analysing protocol activity.
• WIPS (wireless intrusion prevention system) → monitors a wireless
network for suspicious traffic by analysing wireless networking
protocols.
• NBA (network behaviour analysis) → examines network traffic to
identify threats that generate unusual traffic flows → like DDoS
attacks, certain forms of malware and policy violations.
• HIPS (host-based intruder prevention system) → it is an installed
software package that monitors a single host for suspicious activity
by analysing events occurring within that host.
Types of IDS
There are two types of IDS:
• NIDS (network intrusion detection system) → NIDSs are placed at
strategic points within a network to monitor traffic to and from all
devices on the network. It performs analysis of passing traffic on the
entire subnet, and matches the traffic that is passed on the subnets
to the library of known attacks.
• HIDS (host intrusion detection system) → these run on individual
hosts or devices on network. A HIDS monitors the inbound and
outbound packets from the device only and will alert the user or
admin if any suspicious activity is detected.
All IDS use one of the TWO DETECTION TECHNIQUES:
• Statistical Anomaly-based IDS → IDS based on statistical anomaly
will monitor network traffic and compare it against an established
baseline. → The baseline will identify what is “normal” for the
network, and if anything “abnormal” is detected, an intrusion seems
to be detected.
• Rule-based IDS → IDS based un rules will detect intrusion by
observing events in the system and applying a set of rules that lead
to the decision regarding whether a given pattern of activity is or
not suspicious. Two types: rule based anomaly detection, rule based
penetration detection).
Elliptic Curve
• It is a curve that is described by cubic equations (similar to those
used for calculating circumference of an ellipse).
• Cubic equations for elliptic curve takes the form:
• a² + axy + by = x³ + cx² + dx + e
• where a, b, c, d, e are real numbers and x and y take on values in
real numbers.
Replay Attack
• It is an attach in which an attacker obtains a copy of authenticated
packets and later transmits them to the intended destination.
• the reception of duplicate and authenticated packets may disrupt
services for the receiver in some way or another.
MIME
• It is an extension to the RFC 822 framework that is intended to
address some of the problems and limitations of the use of SMTP or
some other mail transfer protocol and RFC 822 for electronic mail.
Firewall Types
Firewall is categorised into three basic types −
• Packet filter (Stateless & Stateful)
• Application-level gateway
• Circuit-level gateway
Packet-filtering firewalls allow or block the packets mostly based on
criteria such as source and/or destination IP addresses, protocol, source
and/or destination port numbers, and various other parameters within
the IP header.
• The decision can be based on factors other than IP header fields
such as ICMP message type, TCP SYN and ACK bits, etc.
Packet filter rule has two parts −
• Selection criteria − It is a used as a condition and pattern matching
for decision making.
• Action field − This part specifies action to be taken if an IP packet
meets the selection criteria. The action could be either block (deny)
or permit (allow) the packet across the firewall.
Circuit Level Gateway (Firewall) is explained on this blog elsewhere.
Application Layer Firewall or proxy gateway, examines and filters
individual packets, rather than simply copying them and blindly
forwarding them across the gateway. Application-specific proxies check
each packet that passes through the gateway, verifying the contents of
the packet up through the application layer. These proxies can filter
particular kinds of commands or information in the application protocols.
• Application gateways can restrict specific actions from being
performed. For example, the gateway could be configured to
prevent users from performing the ‘FTP put’ command. This can
prevent modification of the information stored on the server by an
attacker.
types of firewalls
Triple DES
• The speed of exhaustive key searches against DES after 1990 began
to cause discomfort amongst users of DES.
• However, users did not want to replace DES as it takes an enormous
amount of time and money to change encryption algorithms that
are widely adopted and embedded in large security architectures.
• The pragmatic approach was not to abandon the DES completely,
but to change the manner in which DES is used. This led to the
modified schemes of Triple DES (sometimes known as 3DES).
The encryption-decryption process is as follows:
• Encrypt the plaintext blocks using single DES with key K1.
• Now decrypt the output of step 1 using single DES with key K2.
• Finally, encrypt the output of step 2 using single DES with key K3.
• The output of step 3 is the cipher-text.
• Decryption of a cipher-text is a reverse process. User first decrypt
using K3, then encrypt with K2, and finally decrypt with K1.
Due to this design of Triple DES as an encrypt–decrypt–encrypt process, it
is possible to use a 3TDES (hardware) implementation for single DES by
setting K1, K2, and K3 to be the same value. This provides backwards
compatibility with DES.
triple DES visualisation
SSL
• SSL (Secure Sockets Layer) is a standard security protocol for
establishing encrypted links between a web server and a browser in
an online communication. → The usage of SSL technology ensures
that all data transmitted between the web server and browser
remains encrypted.
• An SSL certificate is necessary to create SSL connection. → You
would need to give all details about the identity of your website and
your company as and when you choose to activate SSL on your web
server. Following this, two cryptographic keys are created — a
Private Key and a Public Key.
• The next step is the submission of the CSR (Certificate Signing
Request), which is a data file that contains your details as well as
your Public Key. The CA (Certification Authority) would then validate
your details.
• The newly-issued SSL would be matched to your Private Key.
• On the apparent level, the presence of an SSL protocol and an
encrypted session is indicated by the presence of the lock icon in
the address bar. A click on the lock icon displays to a user/customer
details about your SSL.
• An SSL Certificate comprises of your domain name, the name of
your company and other things like your address, your city, your
state and your country.
• It would also show the expiration date of the SSL plus details of the
issuing CA. It’s also verified that the CA is one that the browser
trusts, and also that the certificate is being used by the website for
which it has been issued.
• If any of these checks fail, a warning will be displayed to the user,
indicating that the website is not secured by a valid SSL certificate.
SSL/TLS Certificate
• SSL or TLS (Transport Layer Security) certificates are data files that
bind a cryptographic key to the details of an organisation.
• When SSL/TLS certificate is installed on a web server, it enables a
secure connection between the web server and the browser that
connects to it.
• The website’s URL is prefixed with “https” instead of “http” and a
padlock is shown on the address bar. If the website uses an
extended validation (EV) certificate, then the browser may also
show a green address bar.
• DES uses Feistal Cipher Structure while AES uses Substitution and
Permutation Principle.
• DES has smaller key (less secure) while AES has larger key
(comparatively more secure).
• DES has data block divided into two halves while AES has the entire
data block processed as a single matrix.
Stream Cipher vs Block Cipher
Types of Attacks Addressed By Message Authentication
• masquerade
• content modification
• sequence modification
• timing modification
Public Key Cryptography
• Unlike symmetric key cryptography, we do not find historical use of
public-key cryptography. It is a relatively new concept.
• Symmetric cryptography was well suited for organizations such as
governments, military, and big financial corporations were involved
in the classified communication.
• With the spread of more unsecure computer networks in last few
decades, a genuine need was felt to use cryptography at larger
scale. The symmetric key was found to be non-practical due to
challenges it faced for key management. This gave rise to the public
key cryptosystems.
• The process of encryption and decryption is depicted in the
following illustration −
public key cryptography visual aid
RSA Cryptosystem
• This crypto-system is one the initial system. It remains most
employed crypto-system even today. The system was invented by
three scholars Ron Rivest, Adi Shamir, and Len Adleman and hence,
it is termed as RSA crypto-system.
• We will see two aspects of the RSA crypto-system, firstly generation
of key pair and secondly encryption-decryption algorithms.
Generation of RSA Key Pair
Each person or a party who desires to participate in communication using
encryption needs to generate a pair of keys, namely public key and
private key. The process followed in the generation of keys is described
below −
• Generate the RSA modulus (n) — Select two large primes, p and q.
Calculate n=p*q. For strong unbreakable encryption, let n be a large
number, typically a minimum of 512 bits.
• Find Derived Number (e) — Number e must be greater than 1 and
less than (p − 1)(q − 1). There must be no common factor for e and
(p − 1)(q − 1) except for 1. In other words two numbers e and (p —
1)(q — 1) are co-prime.
• Form the public key — The pair of numbers (n, e) form the RSA
public key and is made public. Interestingly, though n is part of the
public key, difficulty in factorising a large prime number ensures
that attacker cannot find in finite time the two primes (p & q) used
to obtain n. This is strength of RSA.
• Generate the private key — Private Key d is calculated from p, q,
and e. For given n and e, there is unique number d. Number d is the
inverse of e modulo (p — 1)(q — 1). This means that d is the number
less than (p — 1)(q — 1) such that when multiplied by e, it is equal
to 1 modulo (p — 1)(q — 1). This relationship is written
mathematically as follows −
ed = 1 mod (p − 1)(q − 1)
RSA Decryption
• The decryption process for RSA is also very straightforward. Suppose
that the receiver of public-key pair (n, e) has received a ciphertext C.
• Receiver raises C to the power of his private key d. The result
modulo n will be the plaintext P.
Plaintext = Cd mod n
RSA Analysis
The security of RSA depends on the strengths of two separate functions.
The RSA crypto-system is most popular public-key crypto-system strength
of which is based on the practical difficulty of factoring the very large
numbers.
• Encryption Function − It is considered as a one-way function of
converting plaintext into cipher-text and it can be reversed only
with the knowledge of private key d.
• Key Generation − The difficulty of determining a private key from an
RSA public key is equivalent to factoring the modulus n. An attacker
thus cannot use knowledge of an RSA public key to determine an
RSA private key unless he can factor n. It is also a one way function,
going from p & q values to modulus n is easy but reverse is not
possible.
If either of these two functions are proved non one-way, then RSA will be
broken. In fact, if a technique for factoring efficiently is developed then
RSA will no longer be safe.
The strength of RSA encryption drastically goes down against attacks if
the number p and q are not large primes and/ or chosen public key e is a
small number.
Elliptic Curve Cryptography
• Elliptic Curve Cryptography (ECC) is a term used to describe a suite
of cryptographic tools and protocols whose security is based on
special versions of the discrete logarithm problem. It does not use
numbers modulo p.
• ECC is based on sets of numbers that are associated with
mathematical objects called elliptic curves. There are rules for
adding and computing multiples of these numbers, just as there are
for numbers modulo p.
• ECC includes a variants of many cryptographic schemes that were
initially designed for modular numbers such as ElGamal encryption
and Digital Signature Algorithm.
• It is believed that the discrete logarithm problem is much harder
when applied to points on an elliptic curve. This prompts switching
from numbers modulo p to points on an elliptic curve.
• Also an equivalent security level can be obtained with shorter keys if
we use elliptic curve-based variants.
• The shorter keys result in two benefits −
• Ease of key management
• Efficient computation
These benefits make elliptic-curve-based variants of encryption scheme
highly attractive for application where computing resources are
constrained.
Honeypots
• A honeypot is a decoy computer system that simulates the
behaviour of a real system having data that seems to be legitimate
part of the network/site, but it is actually isolated and closely
monitored for trapping hackers or tracking unconventional or new
hacking methods, who are then blocked/trapped.
• The main purpose of a Honeypot is to detect and learn from the
attacks and further use the information to improve security.
• Main reasons to setup honeypots: gather understanding and
gather information.
Types of Honeypots
Based on use-case, two types of honeypots:
• research honeypots — These are mainly used or deployed to gather
information and understand about the various attack
methodologies, tactics used by the intruders to gain access into a
system/network. → These honeypots doesn’t add direct value to
any specific organisation, but the information helps in improving
their security.
• production honeypots — These are primarily used for detection and
to protect organisations. The main purpose of a production
honeypot is to help mitigate risk in an organisation. → Increasingly,
however, production honeypots are being recognised for the
detection capabilities they can provide and for the ways they can
supplement both network- and host-based intrusion protection.
Based on design criteria of honeypots, three types of honeypots:
• pure honeypots — Pure honeypots are full-fledged production
systems. The activities of the attacker are monitored by using a bug
tap that has been installed on the honeypot’s link to the network.
No other software needs to be installed. Even though a pure
honeypot is useful, stealthiness of the defence mechanisms can be
ensured by a more controlled mechanism.
• high-interaction honeypots — High-interaction honeypots imitate
the activities of the production systems that host a variety of
services and, therefore, an attacker may be allowed a lot of services
to waste his time. By employing virtual machines , multiple
honeypots can be hosted on a single physical machine. Therefore,
even if the honeypot is compromised, it can be restored more
quickly. In general, high-interaction honeypots provide more
security by being difficult to detect, but they are expensive to
maintain. If virtual machines are not available, one physical
computer must be maintained for each honeypot, which can be
exorbitantly expensive. Example: Honey-net .
• low-interaction honeypots — Low-interaction honeypots simulate
only the services frequently requested by attackers. Since they
consume relatively few resources, multiple virtual machines can
easily be hosted on one physical system, the virtual systems have a
short response time, and less code is required, reducing the
complexity of the virtual system’s security. Example: Honey-d.
Cryptography Primitives
• Cryptography primitives are nothing but the tools and techniques in
cryptography, that can be selectively used to provide a set of
desired security services:
• Encryption
• Hash Functions
• MAC
• Digital Signatures
cryptography primitives and their services offered
Examples :
Text : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Shift: 23
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVWText : ATTACKATONCE
Shift: 4
Cipher: EXXEGOEXSRGI
Operation of DES
• The Data Encryption Standard (DES) is a symmetric-key block cipher
published by the National Institute of Standards and Technology
(NIST).
• DES is an implementation of a Feistel Cipher. It uses 16 round Feistel
structure. The block size is 64-bit. Though, key length is 64-bit, DES
has an effective key length of 56 bits, since 8 of the 64 bits of the
key are not used by the encryption algorithm (function as check bits
only). General Structure of DES is depicted in the following
illustration −
Since DES is based on the Feistel Cipher, all that is required to specify DES
is:
• Round function
• Key schedule
• Any additional processing − Initial and final permutation
DES Analysis
The DES satisfies both the desired properties of block cipher. These two
properties make cipher very strong.
• Avalanche effect − A small change in plaintext results in the very
great change in the cipher-text.
• Completeness − Each bit of cipher-text depends on many bits of
plaintext.
During the last few years, cryptanalysis have found some weaknesses in
DES when key selected are weak keys. These keys shall be avoided.
DES has proved to be a very well designed block cipher. There have been
no significant cryptanalytic attacks on DES other than exhaustive key
search.
Operation of AES
• AES is an iterative rather than Feistel cipher. It is based on
‘substitution–permutation network’. It comprises of a series of
linked operations, some of which involve replacing inputs by specific
outputs (substitutions) and others involve shuffling bits around
(permutations).
• Interestingly, AES performs all its computations on bytes rather than
bits. Hence, AES treats the 128 bits of a plaintext block as 16 bytes.
These 16 bytes are arranged in four columns and four rows for
processing as a matrix −
• Unlike DES, the number of rounds in AES is variable and depends on
the length of the key. AES uses 10 rounds for 128-bit keys, 12
rounds for 192-bit keys and 14 rounds for 256-bit keys. Each of
these rounds uses a different 128-bit round key, which is calculated
from the original AES key.
• The schematic of AES structure is given in the following illustration −
AES Analysis
In present day cryptography, AES is widely adopted and supported in both
hardware and software. Till date, no practical cryptanalytic attacks against
AES has been discovered. Additionally, AES has built-in flexibility of key
length, which allows a degree of ‘future-proofing’ against progress in the
ability to perform exhaustive key searches.
However, just as for DES, the AES security is assured only if it is correctly
implemented and good key management is employed