Im building an Electron desktop app and storing data in a JSON file that I wish to encrypt and decrypt to prevent intentional tampering by the end user. This data will occasionally be read and updated by the app.
I've come to understand that Node's crypto module can handle this functionality.
My question pertains to the specific cipher algorithm to use. In reading Node's documentation, it says we have a choice between those provided by OpenSSL as can be found by calling 'openssl list -cipher-algorithms' in the terminal. Further research pointed me toward AES256 as I saw that it's trusted by governments.
But in whittling it down, there's still 11 variations to select from:
- AES-256-CBC
- id-aes256-CCM
- AES-256-CFB
- AES-256-CFB1
- AES-256-CFB8
- AES-256-CTR
- AES-256-ECB
- id-aes256-GCM
- AES-256-OCB
- AES-256-OFB
I assume that the decision is not arbitrary, and that each of these has a very specific use case. Can anybody point me in the right direction of what may be appropriate? And also, possibly a summary of why the others are not?
=== Update===
@topaco's reference comprehensively addresses this question for my use case, if not by the discussion presented, then by references provided.
Also, for those reading this later. This is a great place to start putting such things in an overarching context.