Encryption in C++

W

Wilson

hello, is it possible, in any way, to encrypt files, or create an
encrypting algorithm using C++

if it is, could you advise on the simplest way of doing this

thanks
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

hello, is it possible, in any way, to encrypt files, or create an
encrypting algorithm using C++

if it is, could you advise on the simplest way of doing this

Find yourself a good book on cryptography, one that explains the
different algorithms used, and start implementing one of them in C++. Or
get yourself a library that implements some cryptographic functions and
used that, most of them are probably written in C but you should be able
to use them in a C++ program with no problems.
 
D

Daniel Kraft

Wilson said:
hello, is it possible, in any way, to encrypt files, or create an
encrypting algorithm using C++

if it is, could you advise on the simplest way of doing this

I believe there is a vast number of possibilities... One very easy
method is to XOR every byte against either a fixed one or an entered
key, like this:

uint8_t byte(readItFromDisc());
byte^=0x34; // Insert key here
writeOut(byte);

When you apply the same algorithm to the encrypted data, you get the
original file out.

Cheers,
Daniel
 
O

osmium

Wilson said:
hello, is it possible, in any way, to encrypt files, or create an
encrypting algorithm using C++

The only tools used is creating an algorithm is the human mind and a vague
notion of what a "computer", whatever that is, can do. Following this step,
you could test your theories by writing a program in C++.
 
P

Protoman

The only tools used is creating an algorithm is the human mind and a vague
notion of what a "computer", whatever that is, can do. Following this step,
you could test your theories by writing a program in C++.

I wrote a program that simulates a 36 character, 10 rotor cipher w/ a
reflector. So, it can be done.
 
J

James Kanze

The only tools used is creating an algorithm is the human
mind and a vague notion of what a "computer", whatever that
is, can do. Following this step, you could test your
theories by writing a program in C++.
[/QUOTE]
I wrote a program that simulates a 36 character, 10 rotor cipher w/ a
reflector. So, it can be done.

You miss his point. You wrote a program that implements an
existing algorithm. You need the algorithm before writing the
program, so the program can't create the algorithm. (Of course,
it's probable that the original poster just expressed himself
poorly. Which IMHO doesn't bode good; people who cannot express
themselves clearly and precisely in their native language don't
have what it takes to become competent programmers.)
 
R

Rolf Magnus

James said:
You miss his point. You wrote a program that implements an
existing algorithm. You need the algorithm before writing the
program, so the program can't create the algorithm.

The OP didn't say it could. He asked if it's possible to use C++ in the
process of creating one.
(Of course, it's probable that the original poster just expressed himself
poorly. Which IMHO doesn't bode good; people who cannot express
themselves clearly and precisely in their native language don't
have what it takes to become competent programmers.)

How do you know what the OP's native language is?
 
K

Kevin Handy

Wilson said:
hello, is it possible, in any way, to encrypt files, or create an
encrypting algorithm using C++ yes.


if it is, could you advise on the simplest way of doing this

I've always favored the rot13 encryption scheme.
Run it through twice for double encryption power!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top