Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- #include"Kxaos.h"
- using namespace std;
- string key = "1234567890123456";
- string pla;
- string Encrypt(string data){
- int len=length(data),keylen=length(key),min_a;
- char now,mod,prev='~';
- string tot="",temp="";
- for(int i=0;i<len;i++){
- cout<<"Current Letter: "<<data[i]<<endl;
- now=data[i];
- cout<<now<<"+"<<keylen*4<<"=";
- now+=keylen*4;
- cout<<now<<endl;
- cout<<now<<"+"<<len*len<<"=";
- now+=len*len;
- cout<<now<<endl;
- cout<<now<<"+"<<prev<<"=";
- now+=prev;
- cout<<now<<endl;
- min_a=0;
- while(isSpecial(now)){
- cout<<now<<" is special; -¤ =";
- now-='¤';
- cout<<now<<endl;
- min_a++;
- }
- tot+=now;
- prev=now;
- temp+=toString(min_a);
- pla=temp;
- cout<<endl;
- }
- return tot;
- }
- string Decrypt(string data){
- int len=length(data),keylen=length(key);
- char now,mod,prev='~';
- string tot="",curr_a;
- for(int i=0;i<len;i++){
- now=data[i];
- now-=prev;
- now-=len*len;
- now-=keylen*4;
- curr_a="";
- curr_a+=pla[i];
- for(int j=0;j<toInteger(curr_a);j++){
- now+='¤';
- }
- tot+=now;
- prev=data[i];
- }
- return tot;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement