// rsa.js
import JSEncrypt from 'jsencrypt';

const publicKey = `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtdxd5D6SahDExxEPsEvHkT5RShkay2xAYdqNGuQnLHcf8yJqPkwylyz8mrGUqrhahC/rbkzUk/liT0omMkmKWkm+cNSyVxqv4YvQ5446LAbqsbaZqxtbsJbtcL4tUZospwnwZynwQnNIO8hmeF3EOuuX7WzaxwS7Ugf8acn9Tez8GCijhtipqySr9Q5SLd9F7HV8EXohpfNDR5uAEL7hgJWe1tGi91eScSt9IEMS2CWEZzCi6WilfyQ8cSFjlBL9MC/LAnlm48b+MS2KBIVDtA2PodGWQMWn8UzXrob6Du2gjlBIWUr5Hu5/kx1IhVYZCctHHBK+fSqftTdJMsRQRwIDAQAB`;

export const rsaEncrypt = (data) => {
    const encrypt = new JSEncrypt();
    encrypt.setPublicKey(publicKey);
    const encryptedData = encrypt.encrypt(data);
    return encryptedData;
};
