C# program to encrypt the letters

Assignment Help Programming Languages
Reference no: EM13936326

The caeser cipher, which shifts all letters by a certain amount, is easy to decipher. Try this, instead of numbers use letters. Consider this, the word is FEATHER. Remove duplicate letters, making FEATHR, and append the rest of the letters of the alphabet in reverse order.

Now encrypt the letters as follows:

Now, write a program that encrypts or decrypts a file using this cipher.

For example,

crypt -d -kFEATHER encrypt.txt output.txt
decrypts a file using the keyword FEATHER. You must always supply a keyword.

This is what I have so far:

#include <iostream>
#include <fstream>
#include <string>

using namespace std;
string rem_Duplicate(string str1)
{
string str2;
int pos;
for (int i = 0; i < str1.length(); i++)
{
if ((pos = str2.find(str1[i])) < 0)
str2 += str1[i];
}
cout << str2 << endl;
return str2;
}

int main()
{
ofstream output_file;
ifstream input_file("output.txt");
output_file.open("input.txt");
string FEATHER;
string key = FEATHER;
cout << "Enter the Key: ";
cin >> key;
key = rem_Duplicate(key);

input_file.close();
output_file.close();

cin.clear();
cin.ignore();
cin.get();

return 0;

Reference no: EM13936326

Questions Cloud

Discuss the media release and newspaper article : Discuss the Media Release and newspaper article in the context of the statement "regulation is the output of a political process". Do you agree or disagree?
C++ program to design a class : The class should have a constructor that accepts a nonnegative integer and uses it to initialize the Numbers object. It should have a member function print() that prints the English description of the Numbers object. Demonstrate the class by writi..
Preparing and analyzing financial statements : As the CFO of your corporation, you are in charge of preparing and analyzing financial statements that will be presented to potential investors and creditors
What is expected relation between relative interest rates : Effects of real interest rates. What is the expected relationship between the relative real interest rates of two countries and the exchange rate of their currencies?
C# program to encrypt the letters : Consider this, the word is FEATHER. Remove duplicate letters, making FEATHR, and append the rest of the letters of the alphabet in reverse order.
Ensure data stored on file servers : Implement and install a website for a hospital. Needs to write an article that shows the WEBSITE DEVELOPMENT. Check and maintain the software which is installed in the network devices.
What are the basic rights of landlords and tenants : What are the requirements and general conditions of a valid lease? What are the basic rights of landlords and tenants? What are their rights in situations such as evictions
What are opportunity costs of starting your own franchise : What firm did you pick? Why is it interesting to you? What are some opportunity costs of starting your own franchise?
Copyright and other privacy policies along with navigations : Create a simple static website. Your website should have the following requirements Requirements: Create a master page Your website should have minimum of 5 different pages Your website should include a form that will register the users.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd