コード例 #1
0
        public SystemSettingsRepository(
            VirtualWorkDatabaseContext mtfDatabase,
            SystemSettingConverter systemSettingConverter,
            PasswordHashRepository passwordHashRepository,
            ProductionCipher productionCipher)
            : base(mtfDatabase, systemSettingConverter, mtfDatabase.SystemSettings)
        {
            this.productionCipher = productionCipher;

            encryptorKey = passwordHashRepository.GetSystemEncryptionPassword("sd4lrR!FÉ.4SW3");
        }
コード例 #2
0
 public string Decrypt(string cipherText, ProductionCipherKey productionCipherKey)
 {
     return(caesarCipher.Encrypt(rotateCipher.Encrypt(xorCipher.Encrypt(cipherText, productionCipherKey.Password), -productionCipherKey.RotateKey), -productionCipherKey.ReplaceKey));
 }
コード例 #3
0
 public string Encrypt(string plainText, ProductionCipherKey productionCipherKey)
 {
     return(xorCipher.Encrypt(rotateCipher.Encrypt(caesarCipher.Encrypt(plainText, productionCipherKey.ReplaceKey), productionCipherKey.RotateKey), productionCipherKey.Password));
 }