473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Encryption in C++

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

Jul 7 '07 #1
9 3827
Wilson wrote:
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
--
Got two Dear-Daniel-Instant Messages
by MSN, associate ICQ with stress --
so please use good, old E-MAIL!
Jul 7 '07 #2
On 2007-07-07 11:23, Wilson wrote:
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.

--
Erik Wikström
Jul 7 '07 #3
On Jul 7, 2:23 am, Wilson <tpw...@googlemail.comwrote:
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
you can find very useful information about the most popular encryption
method "AES" in this link

http://www.iaik.tu-graz.ac.at/research/krypto/AES/

Jul 7 '07 #4
"Wilson" writes:
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++.
Jul 7 '07 #5
On 7 Jul, 06:19, "osmium" <r124c4u...@comcast.netwrote:
"Wilson" writes:
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++.
I wrote a program that simulates a 36 character, 10 rotor cipher w/ a
reflector. So, it can be done.

Jul 7 '07 #6
Wilson wrote:
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
use a library - see for instance
http://en.wikipedia.org/wiki/Advance...ption_Standard, section
implementations
Jul 7 '07 #7
On Jul 7, 7:43 pm, Protoman <Protoman2...@gmail.comwrote:
On 7 Jul, 06:19, "osmium" <r124c4u...@comcast.netwrote:
"Wilson" writes:
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++.
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.)

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jul 7 '07 #8
James Kanze wrote:
On Jul 7, 7:43 pm, Protoman <Protoman2...@gmail.comwrote:
>On 7 Jul, 06:19, "osmium" <r124c4u...@comcast.netwrote:
"Wilson" writes:
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++.
>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.
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?

Jul 8 '07 #9
Wilson wrote:
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!

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 9 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cliff | last post by:
We are trying to connect to 3 different Oracle databases using MS Access as the front-end and ODBC as the connection. The problem that we are having is that 1 of the databases requires a...
113
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
7
by: Alan Silver | last post by:
Hello, I am writing a page where sensitive data is collected (over SSL) and stored in a database. I have been looking at the .NET encryption classes, but am a bit confused as to which is best...
2
by: Sumit Gupta | last post by:
Can anyone please tell me how to encrpt string or any kind of Data. Also the Algorithm of Compression. Any Link tutorial etc. Like : Zip or RAR Formats etc.
9
by: sweety | last post by:
Dear All, How to encrypt a C data file and make binary file and then have to read a bin file at run time and decrypt the file and have to read the data. Any help to achive this pls. Would be...
4
by: pintu | last post by:
Hello everybody.. I hav some confusion regarding asymmetric encryption.As asymmetric encryption it there is one private key and one public key.So any data is encrypted using private key and the...
1
by: =?Utf-8?B?bWljcm9ob2Y=?= | last post by:
Short version: Is there a way to configure (preferably programmatically) the max encryption strength that will be used by the framework when connecting to a particular SSL-protected web service? ...
11
by: John Williams | last post by:
I've written a simple program to do XOR encryption as my first foray into understanding how encryption works. The code compiles fine, however it segmentation faults on every run. using gdb to...
22
by: j1mb0jay | last post by:
I have had to create a simple string encryption program for coursework, I have completed the task and now have to do a write up on how it could be improved at a later date. If you could look...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.