Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GPPP_AES_KEY = []byte{
0x4e, 0x99, 0x06, 0xe8, 0xfc, 0xb6, 0x6c, 0xc9, 0xfa, 0xf4, 0x93, 0x10, 0x62, 0x0f, 0xfe, 0xe8,
0xf4, 0x96, 0xe8, 0x06, 0xcc, 0x05, 0x79, 0x90, 0x20, 0x9b, 0x09, 0xa4, 0x33, 0xb6, 0x6c, 0x1b,
}
AES Key as per the Microsoft documentation https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-gppref/2c15cbf0-f086-4c74-8b70-1f2fa45dd4be
Functions ¶
func GPPPDecryptBase64 ¶
GPPPDecrypt decrypts a base64 encoded string using the fixed AES key and IV
Parameters: - encStr: The base64 encoded string to be decrypted.
Returns: - The decrypted string. - An error if the decryption or unpadding fails.
func GPPPDecryptBytes ¶
GPPPDecryptBytes decrypts a byte slice using the fixed AES key and IV, and returns the decrypted string.
Parameters: - ciphertext: The byte slice to be decrypted.
Returns: - The decrypted string. - An error if the decryption or unpadding fails.
The function performs the following steps: 1. Initializes a fixed null IV (Initialization Vector). 2. Creates an AES cipher block using the fixed AES key. 3. Ensures the ciphertext length is a multiple of the AES block size. 4. Creates a CBC decrypter and decrypts the ciphertext. 5. Removes PKCS#7 padding from the decrypted plaintext. 6. Converts the plaintext from UTF-16LE to a string and returns it.
func GPPPEncrypt ¶
GPPPEncrypt encrypts a plaintext password using the Group Policy Preferences Password encryption algorithm It returns the base64-encoded encrypted string
Types ¶
This section is empty.