public static void Decrypt(long d, long n) { IEnumerable <string> codesEncrypted = File.ReadAllLines(ENCRYPTED_PATH, Encoding.UTF8); string textDecrypted = Rsa.Decrypt(codesEncrypted, d, n); using (StreamWriter writer = new StreamWriter(DECRYPTED_PATH)) { writer.Write(textDecrypted); } }
public static void Encrypt(long p, long q, out long d, out long n) { string text = File.ReadAllText(INPUT_PATH, Encoding.UTF8); string textEncrypted = Rsa.Encrypt(text, p, q, out d, out n); using (StreamWriter writer = new StreamWriter(ENCRYPTED_PATH)) { writer.Write(textEncrypted); } }