Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Decrypt Aj.Sang comsecurity
- #include <iostream>
- #include <string>
- void encrypt( std::string &iostr , int key )
- {
- key %= 26;
- int ch;
- for( auto &it : iostr )
- {
- ch = tolower(it) + key;
- if( ch > 'z' )
- ch -= 26;
- it = ch;
- }
- }
- int main()
- {
- std::string source = "TJUAHJFAHBUTAKHAEISTGINTEDJZPDEVTBDIFSIXJFXVWDZPZPTHZAHJZDGZBHFTEKEZTNWPDGPGBTHZTFEINTZPDJUICHGXAZXBHAGIJZDJXXNIRTBHAHBUTVHBZICWTEZTBJTXBIVT";
- for(int i=26;i>=0;i--){
- std::cout << std::endl;
- encrypt( source , i );
- std::cout << source << std::endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment