@commit451/salamander
Version:
Never be AFK
33 lines • 1.08 kB
TypeScript
export interface EncryptionResult {
encrypted: string;
success: boolean;
}
export interface DecryptionResult {
decrypted: string;
success: boolean;
}
export declare class EncryptionService {
/**
* Generate a random shared secret
* This ensures the backend never knows the encryption key
*/
static generateRandomSecret(): string;
/**
* Simple XOR-based encryption compatible with Dart implementation
*/
static encrypt(data: string, secret: string): EncryptionResult;
/**
* Simple XOR-based decryption
*/
static decrypt(encryptedData: string, secret: string): DecryptionResult;
/**
* Create verification string encrypted with the secret
* This can be stored on the runner to verify the correct secret
*/
static createVerificationString(secret: string): string;
/**
* Verify if a secret is correct by trying to decrypt the verification string
*/
static verifySecret(encryptedVerification: string, secret: string): boolean;
}
//# sourceMappingURL=encryption.d.ts.map