コード例 #1
0
        public async Task <string> GetSCSCipherPasswordAsync(String userId, String password)
        {
            var semilla = await GetSeedAsync();

            User      user = new User(userId, password);
            DESCipher des  = new DESCipher("HGFEDCBA");

            DESCipher desCipher = new DESCipher(des.decryptString(_configuration["GenerateSeed:KEY"]));

            String decryptedKey = desCipher.decryptString(semilla.Key);
            var    sKey         = new AuthenticationSeed(decryptedKey, semilla.Id);

            SCSDESCipher dCipher       = new SCSDESCipher(sKey.Id, sKey.Key);
            Scrambler    scram         = new Scrambler();
            String       scramblerUser = scram.scrambler(user);
            String       toReturn      = dCipher.encrypt(scramblerUser);

            return(toReturn);
        }