security - It's safer to store data in clear or to encrypt it and store the decryption key? -


I am writing an app that needs to deal with important data. I was wondering if it is safe to store these important data in a program variable or to store an encrypted version of data in a variable and decryption key in another variable.

The problem is here, in my opinion, if a data accesses in an empty form or encrypted data with the decryption key, then it basically has access to the data.

So, who is the safest and why?

Is it safe to keep the decryption key safe instead of stored in OS build-in keyring?

Is there any safe way to do this?

Sensitive data stored in long-term storage should always be encrypted. Press the key separately so that the data can not be stolen. You can put it in safe on a USB stick (offset with secure backup copy) and can change it regularly.

Really need to keep the processed data in decrypt and plain text. Make sure that any data, and key, explicitly overwritten before memory is released, what you can do through your operating system, it can be limited, for example, to swap on a secure OS disk Will erase the image of any memory that will not be a normal OS.

Some languages ​​offer secure storage classes to keep things like keys, read the documentation to see what's there.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -