Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Pseudo random number generation lab solution

16/04/2021 Client: muhammad11 Deadline: 2 Day

SEED Labs – Pseudo Random Number Generation Lab 1 Pseudo Random Number Generation Lab Copyright © 2018 Wenliang Du, Syracuse University. The development of this document was partially funded by the National Science Foundation under Award No. 1303306 and 1718086. This work is licensed under a Creative Commons Attribution-NonCommercialShareAlike 4.0 International License. A human-readable summary of (and not a substitute for) the license is the following: You are free to copy and redistribute the material in any medium or format. You must give appropriate credit. If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. You may not use the material for commercial purposes. 1 Overview Generating random numbers is a quite common task in security software. In many cases, encryption keys are not provided by users, but are instead generated inside the software. Their randomness is extremely important; otherwise, attackers can predict the encryption key, and thus defeat the purpose of encryption. Many developers know how to generate random numbers (e.g. for Monte Carlo simulation) from their prior experiences, so they use the similar methods to generate the random numbers for security purpose. Unfortunately, a sequence of random numbers may be good for Monte Carlo simulation, but they may be bad for encryption keys. Developers need to know how to generate secure random numbers, or they will make mistakes. Similar mistakes have been made in some well-known products, including Netscape and Kerberos. In this lab, students will learn why the typical random number generation method is not appropriate for generating secrets, such as encryption keys. They will further learn a standard way to generate pseudo random numbers that are good for security purposes. This lab covers the following topics: • • • • Pseudo random number generation Mistakes in random number generation Generating encryption key The /dev/random and /dev/urandom device files Lab Environment. This lab has been tested on our pre-built Ubuntu 16.04 VM, which can be downloaded from the SEED website. 2 2.1 Lab Tasks Task 1: Generate Encryption Key in a Wrong Way To generate good pseudo random numbers, we need to start with something that is random; otherwise, the outcome will be quite predictable. The following program uses the current time as a seed for the pseudo random number generator. Listing 1: ”Generating a 128-bit encryption key” #include #include #include #define KEYSIZE 16 SEED Labs – Pseudo Random Number Generation Lab 2 void main() { int i; char key[KEYSIZE]; printf("%lld\n", (long long) time(NULL)); srand (time(NULL)); À for (i = 0; i< KEYSIZE; i++){ key[i] = rand()%256; printf("%.2x", (unsigned char)key[i]); } printf("\n"); } The library function time() returns the time as the number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). Run the code above, and describe your observations. Then, comment out Line À, run the program again, and describe your observations. Use the observations in both cases to explain the purpose of the srand() and time() functions in the code. 2.2 Task 2: Guessing the Key On April 17, 2018, Alice finished her tax return, and she saved the return (a PDF file) on her disk. To protect the file, she encrypted the PDF file using a key generated from the program described in Task 1. She wrote down the key in a notebook, which is securely stored in a safe. A few month later, Bob broke into her computer and gets a copy of the encrypted tax return. Since Alice is CEO of a big company, this file is very valuable. Bob cannot get the encryption key, but by looking around Alice’s computer, he saw the key-generation program, and suspected that Alice’s encryption key may be generated by the program. He also noticed the timestamp of the encrypted file, which is "2018-04-17 23:08:49". He guessed that the key may be generated within a two-hour window before the file was created. Since the file is a PDF file, which has a header. The beginning part of the header is always the version number. Around the time when the file was created, PDF-1.5 was the most common version, i.e., the header starts with %PDF-1.5, which is 8 bytes of data. The next 8 bytes of the data are quite easy to predict as well. Therefore, Bob easily got the first 16 bytes of the plaintext. Based on the meta data of the encrypted file, he knows that the file is encrypted using aes-128-cbc. Since AES is a 128-bit cipher, the 16-byte plaintext consists of one block of plaintext, so Bob knows a block of plaintext and its matching ciphertext. Moreover, Bob also knows the Initial Vector (IV) from the encrypted file (IV is never encrypted). Here is what Bob knows: Plaintext: 255044462d312e350a25d0d4c5d80a34 Ciphertext: d06bf9d0dab8e8ef880660d2af65aa82 IV: 09080706050403020100A2B2C2D2E2F2 Your job is to help Bob find out Alice’s encryption key, so you can decrypt the entire document. You should write a program to try all the possible keys. If the key was generated correctly, this task will not be possible. However, since Alice used time() to seed her random number generator, you should be able to find out her key easily. You can use the date command to print out the number of seconds between a specified time and the Epoch, 1970-01-01 00:00:00 +0000 (UTC).

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Engineering Solutions
George M.
Supreme Essay Writer
Coursework Helper
Best Coursework Help
24/7 Assignment Help
Writer Writer Name Offer Chat
Engineering Solutions

ONLINE

Engineering Solutions

I will cover all the points which you have mentioned in your project details.

$49 Chat With Writer
George M.

ONLINE

George M.

I have read your project details. I can do this within your deadline.

$23 Chat With Writer
Supreme Essay Writer

ONLINE

Supreme Essay Writer

I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$49 Chat With Writer
Coursework Helper

ONLINE

Coursework Helper

I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$33 Chat With Writer
Best Coursework Help

ONLINE

Best Coursework Help

Hello, I an ranked top 10 freelancers in academic and contents writing. I can write and updated your personal statement with great quality and free of plagiarism

$45 Chat With Writer
24/7 Assignment Help

ONLINE

24/7 Assignment Help

Hello, I an ranked top 10 freelancers in academic and contents writing. I can write and updated your personal statement with great quality and free of plagiarism

$16 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Psychology Paper - Info - Which of the statements below best describes office layout - How was the triple entente formed - Hyenas marching lion king - Developmentally Appropriate Activity Planning - Explain the difference between implicit biases and stereotypes - G bar limited partnership - Lecture notes word template - Chapter 10 broadcast journalism review questions answers - 400 cubic inches to cubic centimeters - Olivier jacque morgan stanley - [email protected][email protected]~9928097710 GirlfRiEnD Vashikaran Specialist Astrologer in IndORE , lucknOw - Corpus of contemporary american english download - NURS 6660 Final Exam (2019 and 2020 Versions) Walden University - City of crest hill - SPSS - What is the correct formula for aluminum nitrate - 1. what do you notice about the options of each step as they go from number one up? - The damnation of a canyon by edward abbey - Change management tools ppt - St andrews human resources - Quiz - Coursework writing - Andrew carnegie wealth north american review 1889 - Ama hipaa violations and enforcement - Opentable computer system - Nsw fair trading real estate - Hno3 is a stronger acid than hno2 - Strategies for closing gap 3 in service marketing - Mybcommlab answers - Soap case notes social work - How to freebase coke on foil - Essay on use of mobile phones by students - Sales discounts is a revenue account with a credit balance - Discussion questions - 1 million word essay - Research paper for inferential statistics in decision making - Atums pet monster legends - Custom molds inc case study answers - Target behavior in observable and measurable terms - Palomar hospital internship - Mid semester break monash - Digging up the past tbc - INTRODUCTION LEARNERS MUST DEVELOP AN INTRODUCTION ESSAY WITH THE EXPECTATIONS OF THE COURSE USSING THE FOLLOWING PROMPTS - Assignment 1 professional email message - Phyllis english physiotherapist dungannon - Accounting 8 4 mastery problem answers - Principles of high quality assessment ppt - Week -7 discussion - Wk 4, HCS 335: DR 2 - X 6 x 5 expand and simplify - Discussion Topic - Integrative Essay 1 - Jomo kenyatta the gentlemen of the jungle - Power builder bee r - Edexcel gcse drama unit 1 examples - Asic register for access - Beatrice woke from her aptitude test after she - Quick turn - Employee tardiness warning letter - First fleet primary source - I do not ask the wounded person how he feels - Adaptation worksheet answer key - The valley of the ashes - 4 pages..........due by 24 hrs BUSINESS ETHICS RESEARCH PAPER - Product concept document template - The portland hospital prices - What is round character in literature - The wall street journal classroom edition chapter 1 answers - Convert watts to amperage - Terrick terrick national park - Conjugate redox pair example - Religion- Reflection papers - Anu student id card - Champion l5 spark plug - FIN/571: Corporate Finance - Volunteer work for psychology students - How to copy and paste spss output into word - Flue gas analysis ppt - Siemens etu776 trip curves - Experiment 2 effect of temperature on enzyme activity - Nursing Discussion - Personality Disorders - When was crystal palace built - 31 tennyson circuit mill park - Satisfying customer needs and wants definition - St john the baptist trowbridge - Pitney bowes dm125 manual - Ethical dilemmas - Student resource otter history homework - Discussion Board - Due in 24 Hours - 300 Words - 2 APA Scholarly References - No Extension - 25-50 word discussion reply to my original - Research - Conference paper format example - Father and child nightfall analysis - OE W 6 D - Granton castle walled garden - 14.3 gizmo weather maps answer key - The retailer considers visa and mastercard sales as