Concept explainers
(Enforcing Privacy with Cryptography) The explosive growth of Internet communications and data storage on Internet-connected computers has greatly increased privacy concerns. The field of cryptography is concerned with coding data to make it difficult (and hopefully—with the most advanced schemes—impossible) for unauthorized users to read. In this exercise you’ll investigate a simple scheme for encrypting and decrypting data. A company that wants to send data over the Internet has asked you to write a program that will encrypt it so that it may be transmitted more securely. All the data is transmitted as four-digit integers. Your application should read a four-digit integer entered by the user and encrypt it as follows: Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then print the encrypted integer. Write a separate application that inputs an encrypted four-digit integer and decrypts it (by reversing the encryption scheme) to form the original number. [Optional reading project: Research “public key cryptography” in general and the PGP (Pretty Good Privacy) specific public key scheme. You may also want to investigate the RSA scheme, which is widely used in industrial-strength applications.]
Trending nowThis is a popular solution!
Chapter 4 Solutions
Java How To Program (Early Objects)
- 6) Decryption (Substitution Cipher): The following is a substitution cipher. The letters are substituted randomly. Remember that this is a not shift cipher like the Caesar cipher. What does the following quote say? Who said it? Do this by hand. How long did it take you to decipher this message? D'Y JR EAWPD GTCTZ OTTA DYIRZBWGB, DB PRTJ KRYIADKWBT ADOT! TATWGRZ ZRRJTCTABarrow_forwardpizza (python)Mario owns a pizzeria. Mario makes all of his pizzas from 10 different ingredients, using 3 ingredients on each pizza. Mario’s cousin Luigi owns a pizzeria as well. Luigi makes all his pizzas from 9 ingredients, using 4 ingredients on each pizza. Mario and Luigi have made a bet: Mario believes that customers can order a larger selection of pizzas in his pizzeria than they can order in Luigi’s pizzeria. Use functions for this assignment. Implement a factorial() function yourself (do not use the one from the math module) When choosing k items from n possible items, the number of possibilities can be obtained using the following formula: (??)=?!?!(?−?)!(nk)=n!k!(n−k)! Make a function called choose with two parameters n and k, that implements the above formula. Write a program that calculates the number of pizzas Mario and Luigi can make. The outcome should look like this: Mario can make 120 pizzas.Luigi can make 126 pizzas. Luigi has won the bet.arrow_forwardPython Jupyter Notebookarrow_forward
- Introduction to Cryptographyarrow_forwardName courses : data security Decrypt ciphertext obtained from aSubstitution Cipher. Note that there may be meaningless words at the beginning or at the end since the plaintext is divided into equalparts. NMDCUQFRWMYQWNMJUBDPGMSFMCUTWMJQYWLJWDRCZMDDGMJUFULSCQFPDSFYUTJQMTQYMJQMWRVSWFUNQCWPUFUUCWRLQRNTFWMJWRLDXPDSFYUMDAULWRTWMJMJUBDPGMSFMCUFUKCWUNQRNMJURMJUNWXXUFURMAFQRPJUYDXQFWMJBUMWPQBAWMWDRNWYMFQPMWDRSLCWXWPQMWDRQRNNUFWYWDRWRUIUFJUQFNDXSLCWXWPQMWDRQCWPUIURMSFUNMDYQZTJQMWYWMMJULFZKJDRCWXMUNSKADMJWMYKQTYWRYSFKFWYUTJQMRUIUFJUQFNDXSLCWXZWRLWMUHPCQWBUNZDSGRDTTJQMMDAUQSMWXZWYWYSKKDYUZUYYQWNQCWPUNDSAMXSCCZWMBUQRYMDBQGUQRZMJWRLKFUMMWUFTUCCMJURMJULFZKJDRTURMDRWXZDSNDRMGRDTTJQMMDSLCWXZWYZDSQFUQYWBKCUMRQCWPUNWNRDMXUUCURPDSFQLUNMDQYGQRZBDFUVSUYMWDRYQADSMWMYDJUMSFRUNMDMJUBDPGMSFMCUQRNYQWNTJQMUCYUJQNZDSMDCUQFRTUCCMJUFUTQYBZYMUFZMJUBDPGMSFMCUFUKCWUNPDSarrow_forwardCryptography: Alice is setting up an RSA key pair. She selects two prime numbers: 3319, 9397 and selects e = 3271. What are Alice’s public and private keys and what does she broadcast to make them usable? Then encrypt the following using her public key: HELLO WORLDarrow_forward
- Cryptography is the study of protecting information. A cipher is a pair of algorithms ―the first algorithm encrypts a message and the second algorithm decrypts the message. In most cases, a unique key is also required to encode or decode plaintext. The Caesar cipher is one of the simplest and most widely known ciphers. It is named after Julius Caesar who allegedly used it to protect important military directives. Every letter in the plaintext is replaced by a letter N positions down the alphabet. For example, if N = 3, then a => d and b => e. While the idea is remarkably simple, it appeared to work in Ancient Rome. Most people there couldn't read, and those who could simply assumed it was a foreign language. Write a program that implements the Caesar cipher. You program will get from standard input the key N, followed by a line of plaintext. . . The key N should be any integer between 0 and 26 inclusive. If this isn't the case, print an error message and quit. Any numbers or…arrow_forwardcryptography Question! (don't use ai or chatgpt)arrow_forwarde) 11 players football team doing great in several tournaments. Unfortunately, one of the strikers got injured and replaced. He was a star player of the team. After his replacement, his team starts to perform badly. It looks like the whole team depending on one single player. Relate the above story with one of our cryptographic theories and provide an explanation.arrow_forward
- Cryptography problem A child has learned about affine ciphers. The parent says NONONO. The child responds with hahaha, and quickly claims that this is a decryption of the parent’s message. The parent asks for the encryption function. What answer should the child give?arrow_forwardi need the answer quicklyarrow_forwardcryptography Digital signaturearrow_forward
- 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