Example #1
0
        public override void Decrypt(KeyTable keytab)
        {
            var key = keytab.GetKey(Token);

            var decrypted = Decryptor.Decrypt(
                Token.Ticket.EncPart.Cipher,
                key.WithPrincipalName(
                    token.Ticket.SName
                    ),
                KeyUsage.KU_TICKET
                );

            DecodeTicket(decrypted);
        }
Example #2
0
        public static ReadOnlyMemory <byte> GenerateFile(
            string password,
            Guid saltGuid,
            KrbPrincipalName name,
            EncryptionType etype = EncryptionType.AES256_CTS_HMAC_SHA1_96
            )
        {
            var kerbKey = DeriveFromKeyId(password, saltGuid, name, etype);

            using (var stream = new MemoryStream())
                using (var writer = new BinaryWriter(stream))
                {
                    var keytab = new KeyTable(kerbKey);

                    keytab.Write(writer);

                    return(stream.ToArray());
                }
        }
        public override void Decrypt(KeyTable keytab)
        {
            SName = token.Ticket.SName;

            var ciphertext = token.Ticket.EncPart.Cipher;

            var key = keytab.GetKey(token);

            var kerbKey = key.GetKey(MD4Encryptor);

            var decryptedTicket = Decrypt(kerbKey, ciphertext, KeyUsage.KU_TICKET);

            Ticket = new EncTicketPart().Decode(new Asn1Element(decryptedTicket));

            var decryptedAuthenticator = Decrypt(
                Ticket.Key.RawKey,
                token.Authenticator.Cipher,
                KeyUsage.KU_AP_REQ_AUTHENTICATOR
                );

            Authenticator = new Authenticator().Decode(new Asn1Element(decryptedAuthenticator));
        }
Example #4
0
 public virtual void Decrypt(KeyTable keytab)
 {
     throw new NotSupportedException();
 }
Example #5
0
 public abstract void Decrypt(KeyTable keytab);