Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
#include
#include
int main(int argc, char ** argv){ /* * Read a file. for each character, offset by N for the first value, * for every other value, N+previous char value. * Example: enigma -n 3 ABC * A+3=D=4 * B+4= G=6 * C+7=J=10 * */ if(argc !=3){ printf("Usage: %s
\n", argv[0]); return -1; } int offset = atoi(argv[1]); //printf("Offset : %d\n",offset); FILE *file1=fopen(argv[2], "r"); //file to decode if(file1==NULL ){ printf("Input Files ( %s ) Not Found\n", argv[2]); return 0; } int count =0; char c; //file io char unsigned int p; // previous character Index while(c!=EOF){ c =tolower(fgetc(file1)); if (count ==0){ p=c+offset; //p=offset; printf("char: %c Offset: %d value: %c \n",c,offset,c+offset); count ++; offset=p; } if (isalpha(c)>=97 || isalpha(c)<=122){ //get the previous index plus the index of the current value c //offset = p + (c-'a'+1); p=p-c-'a'; printf("P: %d \n",p); offset = p + (c-'a'+1); //p=p+ (c-'a'); // offset = 1; //printf("char: %c Offset: %d value: %c \n",c,offset, c+offset); //deal with other non alphabet characters here printf(" "); } } //sleep(10); //system("clear"); return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)