#include<stdio.h>
#include<string.h>
#include <ctype.h>
#include <iostream>
#include<string>
using namespace std;
void encode(string& arr,int n);
void decode(string& arr,int n);
int main()
{
string arr;int shift=4,i;
printf("Enter a message : ");
std::getline (std::cin,arr);//accept string
for(i=0;i<arr.size();i++)//convert to uppercase
{
arr[i]=toupper(arr[i]);
}
cout<<arr<<endl;//print uppercase
encode(arr,arr.size());//encode message
cout<<arr<<endl;
decode(arr,arr.size());//decode message
cout<<arr<<endl;
return 0;
}
void encode(string& arr,int n)
{int i=0;
for(i=0;i<n;i++)
if(isalpha(arr[i]))//if alphabet then shift 4
{arr[i]=(arr[i]-'A'+4)%26+'A';}
}
void decode(string& arr,int n)
{int i=0;
for(i=0;i<n;i++)
if(isalpha(arr[i]))//if alphabet then shift -4
{arr[i]=(arr[i]-'A'-4)%26+'A';}
}

ior new tr k%2005%281 %29, You are just hired by Google as a senior software developer...
You will be writing a simple Java program that implements an ancient form of encryption known as a substitution cipher or a Caesar cipher (after Julius Caesar, who reportedly used it to send messages to his armies) or a shift cipher. In a Caesar cipher, the letters in a message are replaced by the letters of a "shifted" alphabet. So for example if we had a shift of 3 we might have the following replacements: Original alphabet: A B C...
Can someone please help me for this assignment? Cryptography — the science of secret writing — is an old science; the first recorded use was well before 1900 B.C. An Egyptian writer used previously unknown hieroglyphs in an inscription. We will use a simple substitution cypher called rot13 to encode and decode our secret messages. ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in...
1. This project will extend Project 3 and move the encryption of a password to a user designed class. The program will contain two files one called Encryption.java and the second called EncrytionTester.java. 2. Generally for security reasons only the encrypted password is stored. This program will mimic that behavior as the clear text password will never be stored only the encrypted password. 3. The Encryption class: (Additionally See UML Class Diagram) a. Instance Variables i. Key – Integer...
Cryptography, the study of secret writing, has been around for a very long time, from simplistic techniques to sophisticated mathematical techniques. No matter what the form however, there are some underlying things that must be done – encrypt the message and decrypt the encoded message. One of the earliest and simplest methods ever used to encrypt and decrypt messages is called the Caesar cipher method, used by Julius Caesar during the Gallic war. According to this method, letters of the...
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...
In C please : The tasks in this exam review exercise are structured in levels. You can see the point distribution for the levels at the end. It is strongly recommended that you ensure you have passed all test cases of lower levels before moving up to a higher level. For example, ensure you have completed all Level 0 and 1 tasks before even looking at Level 2 Tasks. MESSAGE ENCODER LEVEL 0: (test cases - 50 points) Start by...
cs55(java) please
Part 1: You are a programming intern at the student transfer counselor's office. Having heard you are taking CS 55, your boss has come to ask for your help with a task. Students often come to ask her whether their GPA is good enough to transfer to some college to study some major and she has to look up the GPA requirements for a school and its majors in a spreadsheet to answer their question. She would like...
WE ARE USING PYTHON TO COMPLETE THIS ASSIGNMENT :) THANK YOU! In this programming assignment, you will write functions to encrypt and decrypt messages using simple substitution ciphers. Your solution MUST include: a function called encode that takes two parameters: key, a 26-character long string that identifies the ciphertext mapping for each letter of the alphabet, in order; plaintext, a string of unspecified length that represents the message to be encoded. encode will return a string representing the ciphertext. a...
python program Use the provided shift function to create a caesar cipher program. Your program should have a menu to offer the following options: Read a file as current message Save current message Type in a new message Display current message "Encrypt" message Change the shift value For more details, see the comments in the provided code. NO GLOBAL VARIABLES! Complete the program found in assignment.py. You may not change any provided code. You may only complete the sections labeled:#YOUR...
Computer Science C++ Help, here's the question that needs to be answered (TASK D): Task D. Decryption Implement two decryption functions corresponding to the above ciphers. When decrypting ciphertext, ensure that the produced decrypted string is equal to the original plaintext: decryptCaesar(ciphertext, rshift) == plaintext decryptVigenere(ciphertext, keyword) == plaintext Write a program decryption.cpp that uses the above functions to demonstrate encryption and decryption for both ciphers. It should first ask the user to input plaintext, then ask for a right...