author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Thu, 16 Apr 2009 12:46:53 +0200 | |
changeset 26 | d227047a3e88 |
parent 9 | c3fecc82ade6 |
child 27 | 81a574d60c15 |
permissions | -rw-r--r-- |
0 | 1 |
/** |
9
c3fecc82ade6
standard tags for git projects
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
8
diff
changeset
|
2 |
* test/demos/crypt.c |
c3fecc82ade6
standard tags for git projects
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
8
diff
changeset
|
3 |
* Copyright (C) 2008 Markus Broeker |
0 | 4 |
*/ |
5 |
||
6 |
#include <stdio.h> |
|
7 |
#include <stdlib.h> |
|
8 |
#include <string.h> |
|
9 |
||
10 |
int main (int argc, char **argv) |
|
11 |
{ |
|
12 |
char *data; |
|
13 |
int i; |
|
14 |
||
15 |
if (argc != 2) { |
|
16 |
printf ("Usage: %s <str>\n", argv[0]); |
|
17 |
return EXIT_SUCCESS; |
|
18 |
} |
|
19 |
||
20 |
/* |
|
21 |
* Its already allocated |
|
22 |
*/ |
|
23 |
data = argv[1]; |
|
24 |
||
25 |
for (i = 0; data[i]; i++) |
|
26 |
data[i] = data[i] + 1; |
|
27 |
||
28 |
printf ("EnCrypted Data: %s\n", data); |
|
29 |
||
30 |
for (i = 0; data[i]; i++) |
|
31 |
data[i] = data[i] - 1; |
|
32 |
||
33 |
printf ("DeCrypted Data: %s\n", data); |
|
34 |
||
8
96d16dfe787a
We use return EXIT_SUCCESS instead of return 0
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
0
diff
changeset
|
35 |
return EXIT_SUCCESS; |
0 | 36 |
} |