|
-
September 12th, 2003, 01:05 AM
#11
(in a nut shell):
a caeser cipher is just a simple form of encryption. Basically its just what you have. You have text which is called 'plain text' and you apply a shift of N characters then you get the enciphered text which you send to someone who then applies -N to get the plain text back.
so did that solve your problem?
That which does not kill me makes me stronger -- Friedrich Nietzche
-
September 12th, 2003, 03:09 AM
#12
-
September 12th, 2003, 03:24 AM
#13
i agree with phaza but if you just use #include <iostream> (because you want to write all your code in C++) make sure your next line or something is using namespace std; Anyways you should just stick with one programming language throughout your program there is a difference between C and C++. You can still type #include <iostream.h> in a C++ program, but it is better to do it like this:
Code:
#include <iostream>
using namespace std;
int main (void)
{
using std::cout;
using std::endl;
std::cout << "1 4/|\ 4 1337 |>r0gr4m3r" << std::endl;
return 0;
}
you dont need to do the std::cout or std::endl stuff because when you type in using namespace std; you are using a using directive (kinda funky sounding)...Anyways, thought i might just teach you a little bit of C++ while we are talking about differences between C and C++
Support your right to arm bears.

^^This was the first video game which i played on an old win3.1 box
-
September 12th, 2003, 03:30 AM
#14
my thoughts too.
yeah by the way why is this thread here it's not security related
-
September 12th, 2003, 07:01 AM
#15
Junior Member
I saw your code. Lot of variables used. Some lines can be cut down.But for timebeing let us have the same and discuss.Have you noticed this in your code;
printf("%d ", inputChar[e] + mod);
You are adding the char with a value but this affects only the display. The value stored in the array will not get changed to the sum.
for example: if I enter 'a' and mod as 20- it prints as 97+20=117 but still the value of the array remains only 97. it should be changed to 117 which only will then deduct the mod while you decode. Or else you will not get the required answer.
Have you heard of cryptography? It means translating plain text into scrumbled text in order to make the text unintelligible to unauthorised persons who view it. By the example encoding and decoding your objective may be that.
"Ceaser" is said to be the first in the list of using cryptography-so his algorithm of crytography is said to be 'Ceaser Cipher'. Nothing to worry. You have got many new algo. now. You can find more information about these in our dicussion forum or in google.
Chokks
-
September 12th, 2003, 01:55 PM
#16
Member
OK
Ok, well..... First.... the reason it is in here and it isn't security related is because a guy I met said that I should go here if I have questions with programming and stick in the forum. Even though it's security related I thought that you might be able to help.
Second... as for the switching between printf and scanf, I think I finally got that out of my system, lol I was just doing it with whichever one I felt like typing at that moment.
umm....
Also the reason why I just have it printf("%d", inputChar[e]+mod); is because I don't need it later. I guess if I needed it later then I could have put it into the array, but I don't so yea.....
Ok, but yea i've gotten the program to work, I took and went through all the steps and applied messages to see if they were working, and I figured out it wasn't displaying right.. it was receiving the numbers ok and translating them, just not displaying them. So I got that done, but if you want to you can try it at:
http://home.comcast.net/~dwcnmv/Encoder.exe
Yea, this whole program was just practice, i've read a beginner C book and I am running on just that, so I need to find some more books.
I think now I am going to try and make something harder, what is another simple type of encryption (I say simple cause I could probably write something to break the first one, lol), but yea what is another simple type of encryption?(that I could do in C++)
Was also thinking of making a binary translator, but it makes it really hard because you can't copy out of the command prompt if they are big outputs that you give to someone.
--------------------------------------------------------------------
E, the modern pi.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|