Example #1
0
 public static Profile DecryptProfile(Profile profile)
 {
     try
     {
         profile.FirstName     = StringCipher.Decrypt(profile.FirstName, EncryptKey);
         profile.LastName      = StringCipher.Decrypt(profile.LastName, EncryptKey);
         profile.HomeLatitude  = StringCipher.Decrypt(profile.HomeLatitude, EncryptKey);
         profile.HomeLongitude = StringCipher.Decrypt(profile.HomeLongitude, EncryptKey);
         profile.FullName      = StringCipher.Decrypt(profile.FullName, EncryptKey);
         return(profile);
     }
     catch (FormatException fe)
     {
         //This should be logged when ILogger is enabled
         Console.WriteLine($"Class Encryptor, FormatException DecryptProfile() i Encryptor= {fe.Message}, HomeLatitude: {profile.HomeLatitude}, HomeLongitude: {profile.HomeLongitude}, ID: {profile.Id}");
         return(profile);
     }
     catch (CryptographicException ce)
     {
         //This should be logged when ILogger is enabled
         Console.WriteLine($"Class Encryptor, CryptographicException DecryptProfile() i Encryptor= {ce.Message}, HomeLatitude: {profile.HomeLatitude}, HomeLongitude: {profile.HomeLongitude}, ID: {profile.Id}");
         return(profile);
     }
 }
Example #2
0
 public static AppLogin DecryptAppLogin(AppLogin appLogin)
 {
     appLogin.GuId     = StringCipher.Decrypt(appLogin.GuId, EncryptKey);
     appLogin.UserName = StringCipher.Decrypt(appLogin.UserName, EncryptKey);
     return(appLogin);
 }
Example #3
0
 public static Token DecryptToken(Token token)
 {
     token.GuId        = StringCipher.Decrypt(token.GuId, EncryptKey);
     token.TokenString = StringCipher.Decrypt(token.TokenString, EncryptKey);
     return(token);
 }
Example #4
0
 public static GPSCoordinate DecryptGPSCoordinate(GPSCoordinate gpscoord)
 {
     gpscoord.Latitude  = StringCipher.Decrypt(gpscoord.Latitude, EncryptKey);
     gpscoord.Longitude = StringCipher.Decrypt(gpscoord.Longitude, EncryptKey);
     return(gpscoord);
 }
Example #5
0
 public static DmzModel.Employment EncryptEmployment(DmzModel.Employment employment)
 {
     employment.EmploymentPosition = StringCipher.Encrypt(employment.EmploymentPosition, EncryptKey);
     return(employment);
 }
Example #6
0
 public static string DecryptUser(string encryptedUser)
 {
     return(StringCipher.Decrypt(encryptedUser, EncryptKey));
 }
 public static AppLogin EncryptAppLogin(AppLogin appLogin)
 {
     appLogin.GuId     = StringCipher.Encrypt(appLogin.GuId, EncryptKey);
     appLogin.UserName = StringCipher.Encrypt(appLogin.Person.Initials, EncryptKey);
     return(appLogin);
 }