Professional Documents
Culture Documents
Lab#2 Implement Monoalphabetic Cipher Encryption-Decryption: Algorithm Used Implementd Tool Name Description
Lab#2 Implement Monoalphabetic Cipher Encryption-Decryption: Algorithm Used Implementd Tool Name Description
Final Outcome:
Dwarkesh(160570107010) 1
Lab#2 Department of Computer Engineering
Implement Monoalphabetic cipher encryption-decryption
Code Snippet:
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
string hacker(string n,int s){
string result="";
for (int i=0;i<n.length();i++)
{
result += char(int(n[i]+s-97)%26 +97);
}
return result;
}
int main(){
string n;
cout<<"Enter your plan text"<<endl;
cin>>n;
int s =0;
s = rand() % 100+1;
cout<<hacker(n,s);
return 0;
Dwarkesh(160570107010) 2