import JSEncrypt from 'jsencrypt';

const PUBLIC_KEY = `MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXl2bQu5E9JYpMaeWHCbGq3efy6S5y1PMwZp6iatu5KYhFJbZ+1oSPVCbz6ETNFx3sayk4m1lnoKmADaOr6Dyo8rWVlmw+yqjB5fzV7sJrla385OpsCDdznHBEK4v2ubQRSq86N2PFGXxSPekQNlmlwfae8ZLi6NGbrbnMRf8beQIDAQAB`;

export function rsaEncrypt(content: string) {
  const encrypt = new JSEncrypt();
  encrypt.setPublicKey(PUBLIC_KEY);

  const encrypted = encrypt.encrypt(content);
  return encrypted || '';
}
