XOR « encrypt « C Q&A

Home
C Q&A
1.assembly
2.buffer
3.Card
4.Cast
5.compile
6.console
7.const
8.constructor
9.database
10.Date
11.Debug
12.Design
13.Development
14.DLL
15.encrypt
16.enum
17.eof
18.Event
19.fork
20.Format
21.gcc
22.gdb
23.graph
24.graphics
25.gui
26.Holiday Event
27.image
28.IP
29.iterator
30.macro
31.makefile
32.malloc
33.Menu
34.mysql
35.network
36.openssl
37.operator
38.password
39.pipe
40.preprocessor
41.printf
42.pthread
43.Regular expression
44.scanf
45.semaphore
46.SerialPort
47.server
48.Socket
49.sql
50.SQLserver
51.sscanf
52.std
53.stdin
54.stdout
55.stl
56.strcmp
57.stream
58.switch
59.Template
60.thread
61.timer
62.unix
63.video
64.Virtual
65.visualstudio
66.winapi
67.windows
68.xml
C Q&A » encrypt » XOR 

1. XOR Encryption & Decrypt.    cboard.cprogramming.com

#include #include #include int main(void) { char data[100]; int key; int length; int i; /* Start Encrypt */ printf("Enter 2 digits key: "); scanf("%d", &key); flushall(); printf("\nEnter data to encrypt: "); scanf("%[^\n]", &data); length = strlen(data); for(i=0; i

2. XOR encryption with user keys    cboard.cprogramming.com

I've been studying up on XOR encryption, planning on using it in another cipher program I have as a way for users to generate their own special keys. I've got the structure of the program written pretty well, but I've started to notice some odd things. Code: Usage programname inputfile[-] outputfile[-] key '-' for stdin or stdout #include #include ...

3. Problems with Xor encryption    cboard.cprogramming.com

Hey guys, I'm trying to develop a Xor ecnryption function but I'm having some problems... Here's what I've so far: Code: #include int main(int argc, char *argv[]) { char string[] = "This is a test!!!"; char key[] = "123"; XorEncrypt (&string, &key); printf("%s", string); getch(); return 0; } int XorEncrypt (char *string, char *key) { int cnt = 0, i, ...

4. Simple Xor Encryption help    cboard.cprogramming.com

long time; /* know C? */ Unprecedented performance: Nothing ever ran this slow before. Any sufficiently advanced bug is indistinguishable from a feature. Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31. The best way to accelerate an IBM is at 9.8 m/s/s. recursion (re - cur' - zhun) n. 1. (see recursion)

5. XOR encryption    cboard.cprogramming.com

I need some help with a XOR program I'm trying to write. I need to know if I'm on the right track here, and how I could decrypt it all. Reverse the process, so to speak. Please have a look at this code, but ignore all the unnecessary printf's, I'm just trying to follow the code through step by step. Are ...

6. XOR encrypt with variable key length    cboard.cprogramming.com

well I have another problem. I make the SLIGHTEST change to Dave_Sinkula's above code, and all of the sudden it stops working. it is now outputting strings of lengths nothing close to the length of the input string, in funny characters ontop of that (again, what looks like what is caused by an overrun, things like smiley face characters and such). ...

7. xor Encryption    cboard.cprogramming.com

The way to see if you are close is to try it out. I used this short program to test out your encoder: Code: #include #include void decrypt (unsigned char buf[37]) { unsigned int nBitNr; unsigned int nIndex = 4; unsigned int nKey = (unsigned int)buf[3] << 24; nKey |= (unsigned int)buf[2] << 16; nKey |= (unsigned int)buf[1] << ...

8. Xor encryption a little off.    forums.devshed.com

How does that not do what I want? If j is larger than the size of the array I want to set j back to zero. I guess I should just do j = 0 then. That would probably be faster. Anways before I had the <= the last byte of the string was always messed up as well, so I ...

9. Xor encryption    forums.devshed.com

>> i know long int is 64 bits The ANSI standard for C (and as far as I know, C++ as well) only says that "the only restriction on the size of long is that it cannot be shorter than the int type". Currently on a 32-bit gcc compiler, both int and long are 32 bits in size. On the 64-bit ...

10. XOR Encryption problem    daniweb.com

//XOR Encryption #include #include //XOR Encryption key char XORkey [] = "simples"; void XOR_encrypt(char* input_file, char* output_file, char* key) { //Open input and output files FILE* input = fopen(input_file, "r"); FILE* output = fopen(output_file, "w"); //Check input file if (input == NULL) { printf("Input file cannot be read.\n"); return; } //Check output file if (output == NULL) { printf("Output ...

11. XOR Encryption    daniweb.com

#include int main(int argc, char *const *argv) { if ( argc == 4 ) { FILE *input = fopen(argv[1], "rb"); FILE *output = fopen(argv[2], "wb"); if ( input != NULL && output != NULL ) { unsigned char buffer[BUFSIZ]; size_t count, i, j = 0; do { count = fread(buffer, sizeof *buffer, sizeof buffer, input); for ( i = 0; ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.