mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
14 lines
505 B
TypeScript
14 lines
505 B
TypeScript
import { Conf } from '@/config.ts';
|
|
import { nip04 } from '@/deps.ts';
|
|
|
|
/** Encrypt a message as the Ditto server account. */
|
|
function encryptAdmin(targetPubkey: string, message: string): Promise<string> {
|
|
return nip04.encrypt(Conf.seckey, targetPubkey, message);
|
|
}
|
|
|
|
/** Decrypt a message as the Ditto server account. */
|
|
function decryptAdmin(targetPubkey: string, message: string): Promise<string> {
|
|
return nip04.decrypt(Conf.seckey, targetPubkey, message);
|
|
}
|
|
|
|
export { decryptAdmin, encryptAdmin };
|