Encryped field control-panel

If I have a field in the control panel (which now is stored in the registry):

Is there any info/docs/examples on how to keep it safe / encrypt it.

can it be done without using an environment variable for the encryption key (since I am making an add-on I would prefer to keep it simple for the user/customer)