Cooper_Assignment #4
.docx
keyboard_arrow_up
School
American Military University *
*We aren’t endorsed by this school
Course
266
Subject
Computer Science
Date
Jan 9, 2024
Type
docx
Pages
3
Uploaded by UltraLemur3395
Cooper:
Assignment 4
Zachary Cooper
Cryptography Concepts: ISSC266
Doctor Leonard Simon
April 30, 2023
2
Assignment 3
A hash is a formula that acts as a summary of the original value after going through a
process. For example, a passcode of “P@ssw0rd!” will be truncated to a fixed size such as
“01101.” Security is only guaranteed if the input is equal to the truncated output (Freeman Law,
Accessed 2023). The benefit to hashes is they are easy to conduct the process but difficult to do
the process backwards, or in reverse. Every unique input is designed to produce a unique out, but this not always the case. A
hash collision is when to different inputs create the same output, or when one hash has two
different inputs. For example, “01101” has an input of not only “P@ssw0rd!” but also the input
“$n4k3.” Hash collisions are issues for many reasons (Freeman Law, Accessed 2023). For one,
message integrity is degraded. No matter the hash algorithm, a hash collision will result in
messages that are incorrect due the multiple possibilities of inputs to one output (Selinger, 2011).
Another issue to arise is hackers taking advantage of collisions to find passwords that are close
enough to get the same hash. Message Digest 5, or MD5, is a hashing algorithm that used to be the most popular
(Freeman Law, Accessed 2023). When it comes to hash collisions, MD5 is very unlikely to
experience a collision due to the way the algorithm works for hashing. MD5 has a process of
timestamping with more of a hash. MD5 will hash the input and then add a timestamp, this
means that the initial hash may be like another but will have a unique timestamp. This timestamp
allows the possibility for over 9 trillion hashes. This number of hashes makes it very difficult for
hash collisions to occur (Selinger, 2011).
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Encryption methods, such as the Caesar Cipher encryption, allow us to encrypt and decrypt text using a special key. Another method of encrypting text / passwords is called hashing. Hashing uses special algorithms to 'scramble' the text, which is tougher to be hacked. The hash function can take numbers, letters, and symbols as input, then the function applies one of the special algorithms to output the scrambled text. The longer the output string is, the harder to hack the hashed data. The difference between hashing and the Caesar Cipher encryption is that one cannot 'decrypt' a hashed data to its original text.
Since a hashed data cannot be decrypted, a user must enter the original text, which will be hashed by the program. Then the program compares the hashed value with the hashed data stored previously for the original text. A salt is used, at times, to create a random sequence that is added to the original text before using the hashing algorithm. This can help prevent the Brute…
arrow_forward
The hash function
h(k)= [(m(kA mod 1)] for A = 2-³
is used to insert the keys 61, 62, 63, 64, and 65 into a hash table of size m = 1000.
The order of the hash codes in the table are given by
a. 625, 125, 0, 750, 875
b. 625, 750, 625, 125, 0
c. 625,125, 0, 875, 750
d. 625, 750, 875, 0, 125
e. 625, 750, 125, 875, 0
arrow_forward
a) An example of the linear hash index is given below. Every time a new overflow
page is added, the bucket pointed by Next is split, and Next is incremented by one.
Show the index state after adding the keys 39, 25, and 29.
hi
ho
Level=0, N=4
000
00
0*8*
001
01
17*33*
010
10
6*26* 42*
011
11
7* 11* 15* 23*
100
00
4* 12* 20*
101
01
5* 13* 21* 37*
Next
arrow_forward
cryptography in hash function
arrow_forward
Computer Science
Within a Java class, write a method that creates n random strings of length 10 and inserts them in a hash table. The method should compute the average time for each insertion.
provide code and output.
arrow_forward
A hash function H accepts a variable length block of data (plaintext) as input and produces a fixed size hash value ix xi.
a. H(N)
b. H(P)
c. M(H)
d. H(M)
arrow_forward
Given a hash table of size 8, and the hash table uses haah() +i+ in the i-th probe for collsion resolution, what are the indexes of the following elements in the table if the
elements are inserted into the table in the following order:
String hashCode
79
111
81
"W
87
66
7.
"g 2
arrow_forward
1. An open hashing scheme requires the use of random access ( true /false ).
2. A good hashing function should ___ distribute the records amongthe buckets.
3. For an open hashing scheme with 100 buckets and 4000 records,the average number of record reads to locate a record is equal to___.
arrow_forward
The hash table array has capacity of 10. Capacity is the number of slots present in the array that is used to build the hashtable. The hash function returns the absolute value of the key mod the capacity of the hash table.
a) Insert these keys in the hash table: 3,23,11,21,1,7,77,8 where the hash table uses quadratic probing to resolve collisions.
b) Search and Delete 3 and 11 from the table. Be careful about changing the status of the table slot to “deleted” after deleting each item.
c)Search 23 and 21 from the table and print their position.
arrow_forward
Question # 1: Use the Multiplicative Cipher method to encrypt the following plaintext:We will succeed in our ventureKey length K = 7 You must show all the steps of your workQuestion # 2: Use the additive cipher with key = 15 to decrypt the message “WTAAD”.You must show all the steps of your work
Question # 3: Use the concept of a one-way hash function to encrypt the following name into a 9 x 9 -dimensional database table. Jonathan Leea) How many rows and columns are there on this tableb) Which indices is Jonathan on this tablec) Why are hash functions relevant in database encryption?d) What would you do to remedy the problem of index congestion on your database?You must show all the steps of your work
Question # 4: Use the multiplicative method to decrypt the following ciphertext.MADWU Key = 5You must show all the steps of your workQuestion # 5: use the XOR technique to encrypt the following statement before transmission: The quick brown fox jumps over the lazy dog
arrow_forward
4 A hash code is generated by the Java hash algorithm for Strings based on a string's highest allowed character count. Explain how a powerful, constant-time hashing method can be created given that Strings have no useful maximum length. Which eight letters, say, would you select to symbolize a string of length l if you had to?
arrow_forward
Which of these is NOT a characteristic of a secure hash algorithm? a. Collisions should be rare. b. A message cannot be produced from a predefined hash. c. The results of a hash function should not be reversed. d. The hash should always be the same fixed size.
arrow_forward
No copy paste answer please!
Correct and detailed answer will be Upvoted else downvoted. Thank you!
arrow_forward
A hash code is generated by the Java hash function for Strings based on a string's highest allowed character count. Explain how a powerful, constant-time hashing algorithm can be created given that Strings have no useful maximum length. Which eight characters, say, would you select to represent a string of length l if you had to?
arrow_forward
hash table
arrow_forward
A message is made of 10 numbers between 00 and 99. A hash algorithm creates a
digest out of this message by adding all numbers modulo 100. The resulting digest
is a number between 00 and 99. Does this algorithm meet the first criterion of a
hash algorithm? Does it meet the second criterion? Does it meet the third criterion?
arrow_forward
Assume a hash table utilizes an array of 13 elements and that collisions are handled by separate chaining.
Considering the hash function is defined as: h(k)=k mod 13.
i)
Draw the contents of the table after inserting elements with the following keys:
36, 243, 261, 180, 217, 180, 21, 16, 182, 202, 91, 97, 166, 78, 33, 70, 51, 58.
arrow_forward
A hash table is a very important data structure in computer science. It is used for fast information retrieval. Itstores data as a < key, value > pair, where the value is indexed by the key. Note that keys must ne unique.Consider the example of storing persons name using the social security number (ssn) as the key. For eachssn x, a hash function h is used, where h(x) is the location to store the name of x. Once we have created atable, to look up the name for ssn x, we can recomputes h(x) and then look up what is stored in that location.In Python, dictionaries are based on hash tables. Typically, the hash function h is deterministic; we do notwant to get different results every time we compute h(x). But h is often chosen to be pseudo-random. Forthis problem, we will assume that h is truly random. Suppose there are k people, with each person’s namestored in a random location (independently), represented by an integer between 1 and n, k < n. It mayhappen that one location has…
arrow_forward
Using the modulus operator within a hash function or on the output of a hash function:
Will always cause rehashing.
Will cause the hash table to shrink.
Can cause collisions.
O Will always produce a unique hash bucket.
arrow_forward
Q4:Let be a hash function whose input is a string of bits of arbitrary size and the output is a string of m bits. Explain why the security of this function is m/2.
arrow_forward
A hash function should be independent of the capacity of the hash table.
Select one:
a. False
O b. True
arrow_forward
A typical hash function often consists of the following three steps:
Group of answer choices
hashing, compressing, and indexing.
multiplication, addition, and modularization.
selecting, digitizing, and combining.
modularization, probing, and indexing.
compressing, hashing, and probing.
arrow_forward
3. Cuckoo hashing. Consider a cuckoo hash table for six items, with two tables of size 5
(similar to what we have in the textbook example). Use the following hash functions to insert
items in the order of U, V, W, X, Y, Z. Be sure to include some steps so that the instructor can
trace your work.
arrow_forward
3. Given the following keys:
68, 39, 89, 28, 79
Take alpha = 0.6
Compute m (size of hash table), and select it to be a prime number.
Now illustrate how you would construct the hash table. Use double hashing as collision resolving
technique.
The original hash function, is h(k)= k mod m
The second hash function for double hashing, h₂(k)=8-(k mod 8)
arrow_forward
Draw the contents of the hash table given the following conditions:
The size of the hash table is 25.
• Linear Probing is used to resolve collisions.
• The hash function H(k) should be calculated in the following way where k is the element
to be hashed:
R(k) = k mod (summation of last two digits of your student id + 7)
If R(k)<10
H(k)=R(k) + 8
else
H(k)=R(k) - 4
What values will be in the hash table after the following sequence of insertions?
55, 65, 8, 18, 20, 11, 56, 27, 15, 167
[Note: Draw the values using a hash table and show your work for partial credit.]
arrow_forward
Exercise 2 - Hashing a String 2
Apply your hash function to anagrams, e.g.,
cat, tac
Will they be given the same hash value?
• How can we remedy this?
We could use the position of the character
as a weight.
1
position
2 3
a
99*1 +97*2 + 116*3
=
641
641 %
11
3
arrow_forward
2-A linear probing hash table of length 10 uses the hash function h(x) = x mod 10 + 1. mod is the reminder opertatro. For example the h(42) = 42 mod 10 +
1 = 2 + 1 = 3 so we insert 42 in t he position 3 in the array.
After inserting 6 integer keys into an initially empty hash table, the array of keys is
1
2
3
4
5
7
8
9.
42
23
34
52
46
33
a- insert the key 35
b- insert the key 12
c- insert the key 10
arrow_forward
Write a complete C program using hashing :
Prompt the user to search for the student id by the student's name
arrow_forward
All of these statements are related to hash function, hash table.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- Encryption methods, such as the Caesar Cipher encryption, allow us to encrypt and decrypt text using a special key. Another method of encrypting text / passwords is called hashing. Hashing uses special algorithms to 'scramble' the text, which is tougher to be hacked. The hash function can take numbers, letters, and symbols as input, then the function applies one of the special algorithms to output the scrambled text. The longer the output string is, the harder to hack the hashed data. The difference between hashing and the Caesar Cipher encryption is that one cannot 'decrypt' a hashed data to its original text. Since a hashed data cannot be decrypted, a user must enter the original text, which will be hashed by the program. Then the program compares the hashed value with the hashed data stored previously for the original text. A salt is used, at times, to create a random sequence that is added to the original text before using the hashing algorithm. This can help prevent the Brute…arrow_forwardThe hash function h(k)= [(m(kA mod 1)] for A = 2-³ is used to insert the keys 61, 62, 63, 64, and 65 into a hash table of size m = 1000. The order of the hash codes in the table are given by a. 625, 125, 0, 750, 875 b. 625, 750, 625, 125, 0 c. 625,125, 0, 875, 750 d. 625, 750, 875, 0, 125 e. 625, 750, 125, 875, 0arrow_forwarda) An example of the linear hash index is given below. Every time a new overflow page is added, the bucket pointed by Next is split, and Next is incremented by one. Show the index state after adding the keys 39, 25, and 29. hi ho Level=0, N=4 000 00 0*8* 001 01 17*33* 010 10 6*26* 42* 011 11 7* 11* 15* 23* 100 00 4* 12* 20* 101 01 5* 13* 21* 37* Nextarrow_forward
- cryptography in hash functionarrow_forwardComputer Science Within a Java class, write a method that creates n random strings of length 10 and inserts them in a hash table. The method should compute the average time for each insertion. provide code and output.arrow_forwardA hash function H accepts a variable length block of data (plaintext) as input and produces a fixed size hash value ix xi. a. H(N) b. H(P) c. M(H) d. H(M)arrow_forward
- Given a hash table of size 8, and the hash table uses haah() +i+ in the i-th probe for collsion resolution, what are the indexes of the following elements in the table if the elements are inserted into the table in the following order: String hashCode 79 111 81 "W 87 66 7. "g 2arrow_forward1. An open hashing scheme requires the use of random access ( true /false ). 2. A good hashing function should ___ distribute the records amongthe buckets. 3. For an open hashing scheme with 100 buckets and 4000 records,the average number of record reads to locate a record is equal to___.arrow_forwardThe hash table array has capacity of 10. Capacity is the number of slots present in the array that is used to build the hashtable. The hash function returns the absolute value of the key mod the capacity of the hash table. a) Insert these keys in the hash table: 3,23,11,21,1,7,77,8 where the hash table uses quadratic probing to resolve collisions. b) Search and Delete 3 and 11 from the table. Be careful about changing the status of the table slot to “deleted” after deleting each item. c)Search 23 and 21 from the table and print their position.arrow_forward
- Question # 1: Use the Multiplicative Cipher method to encrypt the following plaintext:We will succeed in our ventureKey length K = 7 You must show all the steps of your workQuestion # 2: Use the additive cipher with key = 15 to decrypt the message “WTAAD”.You must show all the steps of your work Question # 3: Use the concept of a one-way hash function to encrypt the following name into a 9 x 9 -dimensional database table. Jonathan Leea) How many rows and columns are there on this tableb) Which indices is Jonathan on this tablec) Why are hash functions relevant in database encryption?d) What would you do to remedy the problem of index congestion on your database?You must show all the steps of your work Question # 4: Use the multiplicative method to decrypt the following ciphertext.MADWU Key = 5You must show all the steps of your workQuestion # 5: use the XOR technique to encrypt the following statement before transmission: The quick brown fox jumps over the lazy dogarrow_forward4 A hash code is generated by the Java hash algorithm for Strings based on a string's highest allowed character count. Explain how a powerful, constant-time hashing method can be created given that Strings have no useful maximum length. Which eight letters, say, would you select to symbolize a string of length l if you had to?arrow_forwardWhich of these is NOT a characteristic of a secure hash algorithm? a. Collisions should be rare. b. A message cannot be produced from a predefined hash. c. The results of a hash function should not be reversed. d. The hash should always be the same fixed size.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education