Monthly Archives: March 2020

Cryptography – Caesar Cipher

The Caesar Cipher

The key for the Caesar Cipher will be a number from 1 to 26. Unless you know the key (that is, know the number used to encrypt the message), you won’t be able to decrypt the secret code.

The Caesar Cipher was one of the earliest ciphers ever invented. In this cipher, you encrypt a message by taking each letter in the message (in cryptography, these letters are called symbols because they can be letters, numbers, or any other sign) and replacing it with a “shifted” letter. If you shift the letter A by one space, you get the letter B. If you shift the letter A by two spaces, you get the letter C. Figure 14-1 is a picture of some letters shifted over by three spaces.

To get each shifted letter, draw out a row of boxes with each letter of the alphabet. Then draw a second row of boxes under it, but start a certain number (this number is the key) of spaces over. After the letters at the end, wrap around back to the start of the boxes. Here is an example with the letters shifted by three spaces:

Invent with Python

Making paper cryptography paper tools

A Virtual Cipher Wheel

Assignments:
1. En-Crypt: Caesar Cipher  – Cryptography

Use the cipherwheel to encrypt a message. In a piece of paper, share the encrypted message with a partner.
In this post, you will type the message, the encrypted message and the one piece of information needed for your partner to decrypt it.

2. De-Crypt: Caesar Cipher –  Cryptography
In this post type your partner’s encrypted message and the one piece of information needed to decrypt it. What is the message?

NOTE: Include your partner’s name

In this post type your partner’s encrypted message and the one piece of information needed to decrypt it. What is the message?

NOTE: Include your partner’s name

3. Your Cipher – Cryptography

Design your own cipher and a device to easily encrypt and decrypt messages. Think ahead and prepare a checklist of materials you might need.

  1. Describe your cipher.
  2. Draw a diagram for your device.
  3. Build your device.
  4. Type here decryption instructions.

4. Friend’s Cipher – Cryptography

Find a classmate and exchange ciphers, instructions and encrypted message. After you checked with your classmate that you were able to decrypt the message, comment on the following:
1. Efficiency of the cipher
2. Quality of the instructions

NOTE: If the instructions were not clear or you couldn’t follow them, help your classmate make the right changes.
Include the name of your classmate.

5. Brute Force – Cryptography

If you didn’t have a key to decipher an encrypted message, how would write a program to decrypt it?

Write the pseudocode for you decrypting program using brute force.

Submit the instructions for your encryption device in the corresponding post. Include your name in the instructions.
Print your instructions and attach it to your device. I will “glue/attach” it to a poster. Please hand everything with your name on it.

Cryptography – Resources

Your Cipher – Clwk 9/6/2018 – Cryptography

Due 09/11, 6:45 PM

Instructions

‘3. Design your own cipher and a device to easily encrypt and decrypt messages.

Describe your cipher. Draw a diagram for your device. Build your device. Type here decryption instructions.

    1. Friend’s Cipher – Cryptography

Find a classmate and exchange ciphers, instructions and encrypted message. After you checked with your classmate that you were able to decrypt the message, comment on the following: Efficiency of the cipher Quality of the instructions

NOTE: If the instructions were not clear or you couldn’t follow them, help your classmate make the right changes. Include the name of your classmate.

    1. Brute Force – Cryptography

If you didn’t have a key to decipher an encrypted message, how would write a program to decrypt it?

Write the pseudocode for you decrypting program using brute force.

Submit the instructions for your encryption device in the corresponding post. Include your name in the instructions.

Print your instructions and attach it to your device. I will “glue/attach” it to a poster. Please hand everything with your name on it.

De-Crypt: Caesar Cipher – Clwk 9/6/2018 – Cryptography

Due 09/06, 6:45 PM

Instructions

    1. In this post type your partner’s encrypted message and the one piece of information needed to decrypt it. What is the message?

NOTE: Include your partner’s name

En-Crypt: Caesar Cipher – Clwk 9/6/2018 – Cryptography

Due 09/06, 6:45 PM

Instructions

https://java.mrseliasclasses.org/cryptography-caesar-cipher/

    1. Use the “cipherwheel” to encrypt a message. In a piece of paper, share the encrypted message with a partner. In this post, you will type the message, the encrypted message and the one piece of information needed for your partner to decrypt it.

NOTE: Include your partner’s name Yours should be at the top.

Submit here both messages from you: the encrypted and the decrypted from your partner.

What do you need to tell your partner to be able to decrypt the message?

Encryption and Decryption Hand-written Example

Due 09/11, 6:45 PM

Instructions

Hand-in the paper(s) with your english sentence and the encrypted version for your partner. And, the encrypted sentence from your partner and the english version of it.

Information entropy | Journey into information theory | Computer Science | Khan Academy

https://www.youtube.com/watch?v=2s3aJfRr9gE

Shannon Entropy and Information Gain

https://www.youtube.com/watch?v=9r7FIXEAGvs

https://www.youtube.com/watch?v=9r7FIXEAGvs&t=57s

Entropy in Compression – Computerphile

https://www.youtube.com/watch?v=M5c_RFKVkko

Your Cipher – Clwk 9/6/2018 – Cryptography

Due 09/11, 6:45 PM

Instructions

‘3. Design your own cipher and a device to easily encrypt and decrypt messages.

Describe your cipher. Draw a diagram for your device. Build your device. Type here decryption instructions.

    1. Friend’s Cipher – Cryptography

Find a classmate and exchange ciphers, instructions and encrypted message. After you checked with your classmate that you were able to decrypt the message, comment on the following: Efficiency of the cipher Quality of the instructions

NOTE: If the instructions were not clear or you couldn’t follow them, help your classmate make the right changes. Include the name of your classmate.

    1. Brute Force – Cryptography

If you didn’t have a key to decipher an encrypted message, how would write a program to decrypt it?

Write the pseudocode for you decrypting program using brute force.

Submit the instructions for your encryption device in the corresponding post. Include your name in the instructions.

Print your instructions and attach it to your device. I will “glue/attach” it to a poster. Please hand everything with your name on it.

De-Crypt: Caesar Cipher – Clwk 9/6/2018 – Cryptography

Due 09/06, 6:45 PM

Instructions

    1. In this post type your partner’s encrypted message and the one piece of information needed to decrypt it. What is the message?

NOTE: Include your partner’s name

En-Crypt: Caesar Cipher – Clwk 9/6/2018 – Cryptography

Due 09/06, 6:45 PM

Instructions

https://java.mrseliasclasses.org/cryptography-caesar-cipher/

    1. Use the “cipherwheel” to encrypt a message. In a piece of paper, share the encrypted message with a partner. In this post, you will type the message, the encrypted message and the one piece of information needed for your partner to decrypt it.

NOTE: Include your partner’s name Yours should be at the top.

Submit here both messages from you: the encrypted and the decrypted from your partner.

What do you need to tell your partner to be able to decrypt the message?

Encryption and Decryption Hand-written Example

Due 09/11, 6:45 PM

Instructions

Hand-in the paper(s) with your english sentence and the encrypted version for your partner. And, the encrypted sentence from your partner and the english version of it.

Information entropy | Journey into information theory | Computer Science | Khan Academy

https://www.youtube.com/watch?v=2s3aJfRr9gE

Shannon Entropy and Information Gain

https://www.youtube.com/watch?v=9r7FIXEAGvs

https://www.youtube.com/watch?v=9r7FIXEAGvs&t=57s

Entropy in Compression – Computerphile

https://www.youtube.com/watch?v=M5c_RFKVkko

Mail Order System

Good programming style:

  1. Header (Description, author’s name, date, and java version)
  2. Imports if any.
  3. Driver or tester class.
  4. The program should have a proper exit with a message.
  5. Input/output included as a paragraph comment.

The following description of this assignment can be modified to suit the requirements: it should use at least an ArrayList, it should be object-oriented, and have good programming practices. 

mail-order house sells five products whose retail prices are as follows:

Product 1, $2.98

Product 2, $4.50

Product 3, $9.98

Product 4, $4.49

Product 5, $6.87

Write a java program MailOrder_YI.java and its driver, MailOrderTest.java to prompt the user for the following after a short welcome message.

a) Product number
b) Quantity sold


It should calculate and display the total retail value of all products sold. Use a sentinel-controlled (like “yesNo”) loop to determine when the program should stop looping and display the final results.


Sample output:

Welcome to Mrs. “Elia’s Mail Order Clearing House”
Product 1, $2.98
Product 2, $4.50
Product 3, $9.98
Product 4, $4.49
Product 5, $6.87

Product number?: 1
Quantity?: 2
Do you want to continue?(yes/no): yes
Product number?: 2
Quantity?: 5
Do you want to continue?(yes/no): yes
Product number?: 3
Quantity?: 3
Do you want to continue?(yes/no): yes
Product number?: 4
Quantity?: 1
Do you want to continue?(yes/no): no
Total Price: $62

Required submission:

  1. A short video.
  2. Copy and paste both programs.
  3. Submit the zipped project.

Calories and Fat Calculator

Good programming style:

  1. Header (Description, author’s name, date, and java version)
  2. Imports if any.
  3. Driver or tester class.
  4. The program should have a proper exit with a message.
  5. Input/output included as a paragraph comment.

The following description of this assignment can be modified to suit the requirements: it should use at least an ArrayList, it should be object-oriented, and have good programming practices. 

Write a java program, FoodChart.java, and FoodChartTest.java to provide calories and fat content in a selected number of foods.
– Choose 4 different categories of foods from the link attached to the image or any other resource you might want to use.
– Write a function for each of the categories with at least 5 food choices.
– Display a menu and prompt the user for choices.
– Once the user is finished selecting, display the number of calories and the fat content.

Example:

1. Meats
2. Grains
3. Vegetables
4. Fruit

Choose a category: 2

1. Rice, brown long-grain  Fat: 1.8 grams Calories: 216
2. Pasta, whole wheat      Fat: 1 gram    Calories: 214
3. Pasta, corn             Fat: 1.5 grams Calories: 210
4. Pasta, Quinoa           Fat: 0 grams   Calories: 200
5. Pasta, Soba (buckwheat) Fat: 1.5 grams Calories: 190
Choose the food: 4

Do you want to continue? y/n

if the answer is not:
   The total gram of fat is ... and the calories are ...
   Would you like to start again? y/n
else
    
1. Meats
2. Grains
3. Vegetables
4. Fruit

Choose a category:

Required submission:

  1. A short video.
  2. Copy and paste both programs.
  3. Submit the zipped project.