= 공개키 : 182 = == 류주영 == === 암호화 === {{{~cpp #include #include #include using namespace std; int main() { ifstream fin("source.txt"); // fin과 input.txt를 연결 ofstream fout("source_enc.txt"); // fout과 output.txt를 연결 string input; int key = 74; //cout << "키 값을 입력하세요 : "; //cin >> key; char ch; while(!fin.eof()) { fin.get(ch); if(fin.eof()) break; if((int(ch) + key) < 256) { if(ch!=' ') { for(int j=0;j #include #include using namespace std; int main() { ifstream fin("source_enc.txt"); // fin과 input.txt를 연결 ofstream fout("source_enc2.txt"); // fout과 output.txt를 연결 string input; int key; cout << "공개키를 입력하세요 : "; cin >> key; char ch; while(!fin.eof()) { fin.get(ch); if(fin.eof()) break; if((int(ch) + key) < 256) { if(ch!=' ') { for(int j=0;j