Security Software review and downloads
  • Home
  • Spyware & Spyware Remover
  • Registry & Registry Cleaner
  • Firewall
  • Hacked
  • Uninstall & Uninstaller
  • Antivirus

I am working on an C++ encryption program and I can use some help?

April 14th, 2008 · 1 Comment

Develop a program that performs simple cryptography. The program will allow
the user to enter a string and a cryptographic key, and the program will then encrypt the string using the key and send the output of the encryption to a f\ile.
This is what I have so far
#include <iostream>
#include<string>
using namespace std;
class Message
{
private:
string content;
int location;
public:
Message() : content(""), location(0) {};
Message(string s) : content(s), location(0) {};
string print() const;
void addToContent(string s);
};
string Message::print() const
{
return(content);
}
void Message::addToContent(string s)
{
content.append(s);
}
int main ()
{
string input;

cout << "enter some text: ";
getline(cin, input);

Message rect(input);

cout << "\nText was: " << rect.print() << endl;

return 0;
}
Class message
String content
Int location
1st constructor no arguments and initialize content to null string and location to 0.
2nd constructor takes string as argument and initializes content to the string that is its argument and location to 0.

Void print const() = prints out values of the data member content
Void addtocontent( string next); adds the string next to the data member content
Char getnextchar() returns character fom content first time getnextchar called returns first character from content 2nd time it returns 2nd character form c\
ontent…
Bool empty() returns true if you have read to the end of the string then next character to read will be the null character.

Class Caesar
Int shift;
1st constructor takes no arguments.
2nd constructor takes int as an argument and sets shift to the value of the int.
Void setshift has int as argument and sets shift to value of that argument.
Void encrypt takes character c as an argument and returns a character e
Void encrypt takes character c as an argument and returns a character encrypt applies Caesar cipher to its argument performs a static cast on c to make it i\
nto an integer adds shift to the integere applying modulus arithmetic shift of 2 to letter z will give b and then casts result back to character.

Class filehandlechar
Data member of type fstream
Constructor that opens the file output.txt for output using ios::app so that each time the file is used 1new data gets added to the end of the file
Dtor that closes the file outpt.txt
Void passtofile takes character as ana argument and writes that character to the file output.txt.

Class Encryption
Data member type Caesar
Data member type message
Data member type filehandlechar
Vois encryptthisstring takes string and an integer as its input and uses these along with the methods from Caesar and message to encrypt the string by shift\
ing the characters the amount of the integer
Int main()
Class Message
mymes
I really need to get the framework on it
I can figure out the rest.
Thanks

Related posts:

  • Simple C++ Encryption/Decryption Program. What am I doing wrong??????????????
  • Output should be: Encrypted string is: uijt!jt!b!tfdsfu" Decrypted string is: this...
  • I am disturbed! by this encryption thing in c#?
  • You guys how are you? Me i am not fine because of 1. I am trying to read data from...
  • php encryption?
  • Hello all, I am designing a website and need to encrypt some data. I know how to encrypt...
  • Java Super Constructor error?
  • in my program, i have three programs that inherit the properties of a superclass...
  • Need help determining encryption algorithm?
  • Extra Credit in a computer class, our instructor was also a Crypto Tech in the...
  • Need help determining encryption algorithm?
  • Extra Credit in a computer class, our instructor was also a Crypto Tech in the...
  • Need help determining encryption algorithm?
  • Extra Credit in a computer class, our instructor was also a Crypto Tech in the...
  • Need help determining encryption algorithm?
  • Extra Credit in a computer class, our instructor was also a Crypto Tech in the...
  • Error when compile, please help required in c++?
  • Program.h file #################################################### #pragma once using...
  • Questions about encryption-security?
  • I made an encryption program. But I have a few questions (not programming related) 1)...

    Tags: Encryption


    1 response so far ↓

    • 1 dhvrm // Apr 14, 2008

      So what, exactly, is your question?

    Leave a Comment

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word

    Tags: Email Spam Uninstall spyware Security Software Trend Micro Registry Cleaner Pc Tools Norton Nod32 Kaspersky Internet Security Hacked Firewall Computer Security Avg Avast Antivirus Ad Aware Monitoring Software Encryption Backup


    A Slow System?
    Harassed by DLL errors?
    Plagued by constant Blue Screens?
    Receiving error messages and don't know why?

     
    • Most popular Software downloads

      • Pctools
      • kaspersky
    About | Contact Us | Old Sitemap Security Software review and download . All rights reserved PoweredBy Yahoo!API.