add this js in your respective screen on order to perform frontend encryption.use the above server and client actions as and when needed in your applications.remember to store private key in safe and secure place and never expose the private key to front end client.
client action to be called for encrypting data before sending to server.server action "RSA generatekeys" to be called once to get pair of keys(public and private) and send back public key to client to perform encryption using this key.store private key in a secure environment.load this script in order to execute front-end encryption.