gppp

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func GPPPDecryptBase64(encStr string) (string, error)

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

func GPPPDecryptBytes(ciphertext []byte) (string, error)

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

func GPPPEncrypt(plaintext string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL