crypt.c
changeset 0 af501b0c1716
child 8 96d16dfe787a
new file mode 100644
--- /dev/null
+++ b/crypt.c
@@ -0,0 +1,37 @@
+/**
+ *     $Id: crypt.c,v 1.1.1.1 2008-04-28 17:32:53 mbroeker Exp $
+ * $Source: /development/c/demos/crypt.c,v $
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main (int argc, char **argv)
+{
+    char *data;
+    int i;
+
+    if (argc != 2) {
+        printf ("Usage: %s <str>\n", argv[0]);
+        return EXIT_SUCCESS;
+    }
+
+    /*
+     * Its already allocated
+     */
+    data = argv[1];
+
+    for (i = 0; data[i]; i++)
+        data[i] = data[i] + 1;
+
+    printf ("EnCrypted Data: %s\n", data);
+
+    for (i = 0; data[i]; i++)
+        data[i] = data[i] - 1;
+
+    printf ("DeCrypted Data: %s\n", data);
+
+    return 0;
+}