Create a C# program that makes a copy of a text file but encrypted.
Add the characters of each letter 13 times to encrypt the contents of the text file.
public class FileEncrypter
public static void Main(string args)
string inputFileName = "input.txt";
string outputFileName = "output.txt";
string contents = File.ReadAllText(inputFileName);
string cipher = string.Empty;
byte key = 13;
foreach (char letter in contents)
cipher += (char)(letter + key);
Practice C# anywhere with the free app for Android devices.
Learn C# at your own pace, the exercises are ordered by difficulty.
Your donations support our work and contribute to the maintenance of the app.
Own and third party cookies to improve our services. If you go on surfing, we will consider you accepting its use.