Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

개인키,공개키/강희경,조동영

From ZeroWiki
Revision as of 05:28, 7 February 2021 by imported>Unknown
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

개인키 공개키(개인키 : 47,공개키 : 209)

#include <fstream> 
#include <iostream>
using namespace std; 
 
int main() 
{ 
        ifstream fin("input.txt");   
        ofstream fout("output1.txt");
		
		char num;
		
		while(fin.get(num))
		{
		num += 47 ;		
		fout << num;
		}

		int open_key;
		cout << "공개키를 입력하시오 : ";
		cin >> open_key;

		fout.close();
		fin.close();

		ifstream fin1("output1.txt");
        ofstream fout1("output2.txt");
		

		while (fin1.get(num))
		{
			num += open_key;
			fout1 << num;
		}
		fin1.close();
		fout1.close();
		
		return 0;
}