· 7 years ago · Jun 15, 2018, 12:38 PM
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace ConsoleApplication1
7{
8 class Program
9 {
10 static void Main(string[] args)
11 {
12 int passwordLength = 6;
13 int customerId = 12345;
14 string encrypted = Crypter.Encrypt(customerId, "secretKey", passwordLength);
15 if (customerId == Crypter.Decrypt(encrypted, "secretKey"))
16 {
17 Console.WriteLine("It worked! Well done!");
18 }
19 }
20
21 }
22
23 public static class Crypter
24 {
25 public static string Encrypt(int input, string key, int passwordLength)
26 {
27 string encryptedString = "";
28 //do encrypt stuffz here
29
30 return encryptedString;
31 }
32 public static int Decrypt(string encryoted, string key)
33 {
34 int decrypted = 0;
35 //do decrypt stuffz here
36
37 return decrypted;
38 }
39 }
40}