Question

Jack is a successful lawyer who runs a law firm that deals with sensitive cases. In...

Jack is a successful lawyer who runs a law firm that deals with sensitive cases. In 2017, after the widely known ransomware attacks, their data was compromised. As a protective measure, he requested that all employees must encrypt their messages to each other. Employees generally exchange instructions or case updates with messages that are no longer than thirty characters each. For the purpose of hiding the meaning of the messages, they were told to encrypt them using Caesar cipher substitution then using another substitution where the key is 567. Once the message is processed through the aforementioned methods, they added an extra layer of security by encrypting the message with One Time Pad that increments by one each time it’s used but remains less or equals to 15 for encryption and decryption. For one particular message between two employees, that key was: 7,15,12,6,8,9,4,2,1,13,12,5,3,1,8,15,6,4,8,12,8,10,9,14,6,11,13,2,4,6 When the receiver received the message, he/she received the following ciphertext: LC DOMX IZY XVHP XMJQSH AANW FIHABRT What is the plaintext?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

//Decryption for caeser cipher

#include <iostream>

#include <cstring>

using namespace std;

int main()

{

    int key;

    char msg[100],cur;

    cout<<"Enter Key";

    cin>>key;

    cout<<"Enter msg";

    cin>>msg;

    for(int i=0;i<strlen(msg);i++)

    {

        cur=msg[i];

        if(cur>='A'&&cur<='Z')

        {

            cur=cur-key;

            if(cur<'A')

            {

                cur=cur+'Z'-'A'+1;

            }

            msg[i]=cur;

        }

        if(cur>='a'&&cur<='z')

        {

            cur=cur-key;

            if(cur<'a')

            {

                cur=cur+'z'-'a'+1;

            }

            msg[i]=cur;

        }

        if(cur>='0'&&cur<='9')

        {

            cur=cur-key;

            if(cur<'0')

            {

                cur=cur+'9'-'0'+1;

            }

            msg[i]=cur;

        }

    }

    cout<<"Decrypted message"<<msg;

    return 0;

}

//Substitution Cipher

#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<stdbool.h>
#include<stdio.h>

bool Cipher(char* str, char* plainAlphabet, char* key, char* cipherText)
{
   int strLen = strlen(str);

   if (strlen(plainAlphabet) != strlen(key))
       return false;

   for (int i = 0; i < strLen; ++i)
   {
       const char* ptr = strchr(plainAlphabet, tolower(str[i]));
       int oldCharIndex = ptr - plainAlphabet;
  
       if (ptr && oldCharIndex >= 0)
           cipherText[i] = isupper(str[i]) ? toupper(key[oldCharIndex]) : key[oldCharIndex];
       else
           cipherText[i] = str[i];
   }

   cipherText[strLen] = '\0';
   return true;
}

bool Encipher(char* str, char* key, char* cipherText)
{
   char* plainAlphabet = "abcdefghijklmnopqrstuvwxyz";
   return Cipher(str, plainAlphabet, key, cipherText);
}

bool Decipher(char* str, char* key, char* cipherText)
{
   char* plainAlphabet = "abcdefghijklmnopqrstuvwxyz";
   return Cipher(str, key, plainAlphabet, cipherText);
}

int main()
{
char* str[100];
char* key[26];
printf("Enter text:\t");
scanf("%s",str);
printf("Key:\t");
scanf("%s",key);
char* cipherText = (char*)malloc(strlen(str));
char* originalText = (char*)malloc(strlen(cipherText));

bool encipherResult = Encipher(str, key, cipherText);
bool decipherResult = Decipher(cipherText, key, originalText);
printf("\n%s",originalText);
printf("\n%s",cipherText);

return 0;
}

Add a comment
Know the answer?
Add Answer to:
Jack is a successful lawyer who runs a law firm that deals with sensitive cases. In...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • in c++ The science of writing secret codes is called cryptography. For thousands of years cryptography...

    in c++ The science of writing secret codes is called cryptography. For thousands of years cryptography has made secret messages that only the sender and recipient could read, even if someone captured the messenger and read the coded message. A secret code system is called a cipher. In cryptography, we call the message that we want to be secret the plaintext. The plaintext could look like this:  Hello there! The keys to the house are hidden under the flower pot. Converting...

  • JAVA Problem: With the recent news about data breaches and different organizations having their clients’ information...

    JAVA Problem: With the recent news about data breaches and different organizations having their clients’ information being exposed, it is becoming more and more important to find ways to protect our sensitive data. In this program we will develop a simple tool that helps users generate strong passwords, encrypt and decrypt data using some cyphering techniques. You will need to create two classes. The first class is your driver for the application and contains the main method. Name this class...

  • Can i get Playfair Cipher for python 3 that encrypts a message and decrypts it, could...

    Can i get Playfair Cipher for python 3 that encrypts a message and decrypts it, could you possibly make it as simple as you can without losing functionality. please include comments, that would help me better understand Example of PlayFair Cipher: https://en.wikipedia.org/wiki/Playfair_cipher The Playfair cipher uses a 5 by 5 table containing a key word or phrase. Memorization of the keyword and 4 simple rules was all that was required to create the 5 by 5 table and use the...

  • C Program In this assignment you'll write a program that encrypts the alphabetic letters in a...

    C Program In this assignment you'll write a program that encrypts the alphabetic letters in a file using the Vigenère cipher. Your program will take two command line parameters containing the names of the file storing the encryption key and the file to be encrypted. The program must generate output to the console (terminal) screen as specified below. Command Line Parameters Your program must compile and run from the command line. The program executable must be named “vigenere” (all lower...

  • Chapter 06 Applied Cryptography 1. How is integrity provided? A. Using two-way hash functions and digital...

    Chapter 06 Applied Cryptography 1. How is integrity provided? A. Using two-way hash functions and digital signatures B. Using one-way hash functions and digital signatures C. By applying a digital certificate D. By using asymmetric encryption 2. Which term refers to the matching of a user to an account through previously shared credentials? A. Nonrepudiation B. Digital signing C. Authentication D. Obfuscation 3. Which term refers to an arranged group of algorithms? A. Crypto modules B. Cryptographic service providers (CSPs)...

  • **DO IT AS PYTHON PLEASE** The Trifid Cipher General Problem Description The Trifid cipher (not to be confused with the...

    **DO IT AS PYTHON PLEASE** The Trifid Cipher General Problem Description The Trifid cipher (not to be confused with the creatures from the classic science-fiction film "The Day of the Triffids") is an algorithm that enciphers a plaintext message by encoding each letter as a three-digit number and then breaking up and rearranging the digits from each letter's encoded form. For this assignment, you will create a set of Python functions that can encode messages using this cipher (these functions...

  • CaesarCipher Introduction Hiding the meaning of messages by putting them in some kind of code is...

    CaesarCipher Introduction Hiding the meaning of messages by putting them in some kind of code is something we have all done, from the “coding rings” and secret symbols of childhood to the top secrecy of military and commercial establishments’ secret data. In fact, some of the earliest uses of computers were for coding messages and for breaking the enemy’s coded messages. Newer coding methods are among the most interesting research areas in computer science today. The Caesar Cipher One of...

  • JAVA PROJECT Part 1 - Normalize Text The first thing we will do is normalize the...

    JAVA PROJECT Part 1 - Normalize Text The first thing we will do is normalize the input message so that it’s easier to work with. Write a method called normalizeText which does the following: Removes all the spaces from your text Remove any punctuation (. , : ; ’ ” ! ? ( ) ) Turn all lower-case letters into upper-case letters Return the result. The call normalizeText(“This is some \“really\” great. (Text)!?”) should return “THISISSOMEREALLYGREATTEXT” Part 2 - Obfuscation...

  • CASE 8 Unlocking the Secrets of the Apple iPhone in the Name of access the male...

    CASE 8 Unlocking the Secrets of the Apple iPhone in the Name of access the male San Bernardino suspect's iPhone 5c. Cook stated: Antiterrorism We are challenging the FBI's demands with the deepes respect for American democracy and a love of our country. We believe it would be in the best interest of everyone to step back and consider the implications While we believe the FBI's intentions are good, if would be wrong for the w e nt to force...

  • Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around...

    Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around risk and threat management, fostering an environment in which objectives seem clear: manage risk, manage threat, stop attacks, identify attackers. These objectives aren't wrong, but they are fundamentally misleading.In this session we'll examine the state of the information security industry in order to understand how the current climate fails to address the true needs of the business. We'll use those lessons as a foundation...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT