public bool VerifyTSXClient(byte[] OnlineKey, byte[] EncryptedTS) { // Still figuring out how I am going to deal with this so I am going to cheat a bit :P byte[] dec_ts = KerberosCrypto.KerberosDecrypt(Interop.KERB_ETYPE.rc4_hmac, Interop.KRB_KEY_USAGE_AS_REQ_PA_ENC_TIMESTAMP, OnlineKey, EncryptedTS); string actualts = Encoding.UTF8.GetString(dec_ts.Skip(6).Take(15).ToArray()); if (actualts != null) { return(true); } return(false); }
public bool VerifyTSXClient(byte[] OnlineKey, byte[] EncryptedTS) { byte[] dec_ts = KerberosCrypto.KerberosDecrypt(Interop.KERB_ETYPE.rc4_hmac, Interop.KRB_KEY_USAGE_AS_REQ_PA_ENC_TIMESTAMP, OnlineKey, EncryptedTS); Logger.Info(BitConverter.ToString(dec_ts).Replace("-", "")); AsnElt timestamp_encoded = AsnElt.Decode(dec_ts, false); DateTime timestamp = timestamp_encoded.Sub[0].Sub[0].GetTime(24); long usec = timestamp_encoded.Sub[1].Sub[0].GetInteger(); if (timestamp != null && usec != null) { Logger.Info("Successfully decrypted & decoded timestamp/usec"); Logger.Info(timestamp + " : " + usec); return(true); } else { return(false); } }