Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Hashing Functions Properties

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Hashing Functions Properties:

Hashing functions take some data as input and produce an output (called hash digest)

of fixed length for that input data. This output should, however, satisfy some

conditions to be useful.

1. Uniform distribution: Since the length of the output hash digest is of a

fixed length and the input size may vary, it is apparent that there are going

to be some output values that can be obtained for different input values.

Even though this is the case, the hash function should be such that for any

input value, each possible output value should be equally likely. That is to

say that every possible output has the same likelihood to be produced for

any given input value.

2. Fixed Length: This is should be quite self-explanatory. The output values

should all be of a fixed length. So, for example, a hashing function could

have an output size of 20 characters or 12 characters, etc. SHA-512 has an

output size of 512 bits.

3. Collision resistance: Simply speaking, this means that there aren’t any or

rather it is not feasible to find two distinct inputs to the hash function that

result in the same output (hash digest).


There are many other applications of hashing, including modern day cryptography hash
functions. Some of these applications are listed below:
Message Digest
Password Verification
Data Structures(Programming Languages)
Compiler Operation
Rabin-Karp Algortithm
Linking File name and path together
SHA

https://medium.com/@zaid960928/cryptography-explaining-sha-512-ad896365a0c1

On a particular system, all passwords are 8 characters, there are 64 choices for each

character, and there is a password file containing the hashes of 2048 passwords. Trudy

has a dictionary of 225 passwords, and the probability that a randomly selected

password is in her dictionary is 1/5. Work is measured in terms of the number of hashes

computed.

(i). Suppose that Trudy wants to recover Alice's password. Using her dictionary, what is

the expected work for Trudy to crack Alice's password, assuming the passwords are not

salted?

(ii). Repeat part (i), assuming the passwords are salted.

(iii) What is the expected work for Trudy to crack any one password on the system,

assuming that Trudy does not have dictionary?

(iv). Suppose Trudy has a password cracking program that can test 64 passwords per

second. How long, on average, will it take Trudy to crack Alice’s password assuming

passwords are not salted and Trudy has a dictionary?

i. Unsalted=2 -----------2M
24

ii. Salted:1/5(2 )+4/5(2 ,


24 47)

Dictionary amount of work is 2 hashes------------2M


24

iii. No dictionary=2 ------2M


47

No salt 2 /2 =2
47 11 36

iv         2 sec—2M
18

What is a Firewall?
A firewall is a security device that monitors network traffic. It protects the internal
network by filtering incoming and outgoing traffic based on a set of established
rules. Setting up a firewall is the simplest way of adding a security layer between a
system and malicious attacks.

Packet-Filtering Firewalls
When it comes to types of firewalls based on their method of operation, the most
basic type is the packet-filtering firewall. It serves as an inline security checkpoint
attached to a router or switch. As the name suggests, it monitors network traffic by
filtering incoming packets according to the information they carry.

As explained above, each data packet consists of a header and the data it transmits.
This type of firewall decides whether a packet is allowed or denied access based on
the header information. To do so, it inspects the protocol, source IP address,
destination IP, source port, and destination port. Depending on how the numbers
match the access control list (rules defining wanted/unwanted traffic), the packets
are passed on or dropped.
– No payload check.
– Fast and efficient for filtering
– Vulnerable to IP spoofing.
headers.
– Cannot filter application layer
– Don’t use up a lot of resources.
protocols.
– Low cost.
– No user authentication.
ADV DISADV

Stateful Inspection Firewalls


A stateful inspection firewall keeps track of the state of a connection by monitoring
the TCP 3-way handshake. This allows it to keep track of the entire connection –
from start to end – permitting only expected return traffic inbound.

When starting a connection and requesting data, the stateful inspection builds a
database (state table) and stores the connection information. In the state table, it
notes the source IP, source port, destination IP, and destination port for each
connection. Using the stateful inspection method, it dynamically creates firewall
rules to allow anticipated traffic.

This type of firewall is used as additional security. It enforces more checks and is
safer compared to stateless filters. However, unlike stateless/packet filtering,
stateful firewalls inspect the actual data transmitted across multiple packets instead
of just the headers. Because of this, they also require more system resources.
– Not as cost-effective as they
–Keep track of the entire session. require more resources.
– Inspect headers and packet – No authentication support.
payloads. – Vulnerable to DDoS attacks.
– Offer more control. – May slow down performance
– Operate with fewer open ports. due to high resource
requirements.
Proxy Firewalls
A proxy firewall serves as an intermediate device between internal and external
systems communicating over the Internet. It protects a network by forwarding
requests from the original client and masking it as its own. Proxy means to serve
as a substitute and, accordingly, that is the role it plays. It substitutes for the client
that is sending the request.

When a client sends a request to access a web page, the message is intersected by
the proxy server. The proxy forwards the message to the web server, pretending to
be the client. Doing so hides the client’s identification and geolocation, protecting
it from any restrictions and potential attacks. The web server then responds and
gives the proxy the requested information, which is passed on to the client.
– Protect systems by preventing – May reduce performance.
contact with other networks. – Need additional configuration to
– Ensure user anonymity. ensure overall encryption.
– Unlock geolocational – Not compatible with all network
restrictions. protocols.

ACl Clist

1. An ACL specifies which users or system processes are granted access to objects, as
well as what operations are allowed on given objects
2. ACLs correspond to the columns of an access control matrix, and C-Lists
correspond to the rows of an access control matrix.
3. Suppose we wanted to revoke subject s's access rights r to a file f. If the
system used access control lists, one would revoke the access by going to f's
ACL and deleting s's rights r. If the system used capability lists, one would
revoke the access by going to s's capability list and remove the capability
that gives s the r rights over f.
With ACLs, it is trivial to remove all rights to a given object from all
subjects. With C-lists it is much more difficult. For example, suppose we
want to remove all users' rights to read a file f. We need traverse only one
ACL, but will need to traverse every process' C-List to see if that process
has read rights over f. Conversely, with C-Lists, it is easy to remove all
rights to all objects from a given subject. With ACLs, it is much harder. For
example, we want to remove a subject s's rights to all objects. We need
traverse only one C-List, but would need to traverse every file's ACL

4.-       In a capabilities-based system, when Alice invokes the compiler, she can simply
give her C-list to the compiler. The compiler then consults Alice's C-list when checking
privileges before attempting to create the debug file. Since Alice does not have the
privilege to overwrite BILL.
-    ACLs are preferable when users manage their own files and when protection is data
oriented. With ACLs, it's also easy to change rights to a particular resource.
-    ACL is easier
5.Capabilities are always better to delegate when compared to ACLs, because of
following exempleries
4. ACL: run process using the name of the caller, or OS can explicitly support
delegation
5. Capabilities: allow delegation “ for free ”
6. ♦ When a subject holds a capability for an object, it knows it has access to that object
7. – In contrast, with ACLs it is impossible for a subject to obtain a list of all files it is
allowed to read
8. ♦ Capabilities allow finer-grained treatment of subjects
9. – E.g., at the process level rather than the user level
10. ♦ Capabilities allow easier delegation
11. – In ACLs, usually all-or-nothing (if allowed at all)
12. – With capabilities, can delegate a subset of the rights you have
13. ♦ Better at enforcing “ principle of least privilege ”
14. – Provide access to minimal resources, to the minimal set of subjects

Digital sign vs Authentication


• have looked at message authentication
– but does not address issues of lack of trust
• digital signatures provide the ability to:
– verify author, date & time of signature
– authenticate message contents
– be verified by third parties to resolve disputes
• hence include authentication function with additional capabilities
• -----------------------------
• used to convince parties of each others identity and to exchange session
keys
• may be one-way or mutual
• key issues are
• confidentiality – to protect session keys
• timeliness – to prevent replay attacks
•  Explain DSS, its approaches and its algorithm with
proof.
• Ans.: The Digital Signature Standard (DSS) was published by the
National Institute of Standards and Technology (NIST) as
the Federal Information Processing Standard (FIPS 186). It was
originally developed in 1991. However, it was then criticized by the
public because of lack of security in the scheme. Thus, it was
revised in 1993, and finally in 2000, an elaborated version of DSS
came into existence, which was named FIPS 186-2. The DSS uses
Secure Hash Algorithm (SHA) and presents a new digital signature
scheme, Digital Signature Algorithm (DSA).
• As in the ElGamal digital signature scheme, in the DSS scheme
also two functions F1 and F2 are used to create two different digital
signatures S1 and S2, respectively. However, in DSS scheme, the
message digest (not the message) is used to create the digital
signature S2. The sender transmits S1, S2 and M to the receiver. On
receiving the message and the two signatures, the receiver
computes the message digest using the same hash function, and
calculates the verification code Vc using another function F3. Now,
the receiver compares Vc with S1; if both are congruent, the message
is accepted; otherwise it is rejected. The DSS scheme is shown
in Figure 8.4.

The key generation, signing and verifying algorithms for DSS scheme are
described as follows. All the algorithms use the following global
parameters:
L = length of the key in bits, where the number of bits are a multiple of
64; L lies between 512 and 1024 bits
p = prime number such that 2  < p < 2
L-1 L

q = a 160-bit prime factor of (p−1)


, where e0 is a primitive element in Zp with 1 < e0 < p−1, such
that e1 > 1
M = message to be signed
h(M) = hash of message M using the SHA algorithm
Key generation: The sender generates his or her private and public keys
as follows:
   Private key: The sender chooses a random integer d such that 0 < d <
q; d becomes the private key of the sender
   Public key: The sender computes the following:

The public key of sender becomes (e1, e2, p, q)


Signing: To create the signature, the sender chooses a random number k,
such that 0 < k < q, and then computes the value of S1 and S2 as follows:

(S1 is independent of the message M)

Digital signature = (S1, S2)


Verifying: The receiver verifies the signature as follows:
He or she first checks whether 0 < S1 < p and 0 < S2 < q, and then computes the
digest of the message using the same hash function h(M). The receiver
finally computes the verification code Vc as follows:

where,

(w, y and z are intermediate variables)


Now, the receiver tests whether S1 ≡ Vc. If the condition is satisfied, the
signature is accepted; else, it is rejected.

9. Explain ElGamal digital signature scheme.


Ans.: The ElGamal digital signature scheme also consists of three
different components, namely, key generation, signing and verifying.
All the three components use separate algorithms. In this scheme, four
functions are used, in which one function is common in both the signing
and verification process, however, with different inputs. Thus, in total,
only three different functions are used in the whole process.
In the signing process, two functions F1 and F2 are used to create two
different digital signatures S1 and S2, respectively. The sender transmits
the message M and the signatures S1 and S2 to the receiver. On receiving
the message and the two signatures, the receiver computes two
verification codes V1 and V2 with the help of the functions F1 and F3,
respectively. Now, the receiver compares two codes V1 and V2; if both are
congruent, the message is accepted; otherwise it is rejected. The ElGamal
digital signature scheme is shown in Figure 8.3.

The key generation, signing and verifying algorithms for ElGamal digital
signature scheme are described as follows:
Key generation: The sender generates his or her private and public keys
as follows:
(i) The sender chooses a large prime number p, such that the discrete log
problem is difficult in  .
(ii) The sender then chooses his or her private key d, such that 1≤d < p−1,
and computes  , where e1 is a primitive root  . The public
key of A is (e1, e2, p), and the private key is d.
Signing: To create the signature, the sender chooses a random number k,
such that 0 < k < q, and then computes the value of S1 and S2 as follows:

(S1 is independent of the message M)

(where k  is the multiplicative inverse of k modulo p)


−1
Digital signature = (S1, S2)
Verifying: The receiver verifies the signature as follows.
He or she first checks whether 0 < S1 < p and 0 < S2 < p−1, and then computes
the two verification codes V1 and V2 as follows:

Now, the receiver tests whether V1 ≡ V2. If the condition is satisfied, the
signature is accepted; else, it is rejected.

You might also like