The question is more generally from a constructive point and realization but I'd be grateful for example or link with example (not only theory).
The idea is as follows:
- Everything should be done locally.
- Any library whatsoever is allowed but whole program should be portable, and so omit fancy things that aren't portable.
- Platform - Win7+
- Completely no size limits.
- The safer - the better.
- WPF.
Don't ask why, all of the above^ is a must and point.
Now closer to the point itself. So the program workflow and data management should look ~like:
- User starts obfuscated, single instance, etc. (you can omit this in your example) WPF exe.
- User selects the file (if already exists it will be overwritten on save, if not then it will be created on save)(you can omit this one as well).
- Now user provides all of the data needed by encryption (e.g. for AES - key and IV)(encryption is UP for a discussion - let me know which one you think will suit me more and why, after reading whole wall of text of course, thanks) and press to proceed and read the encrypted data from file (if file was selected).
Before going any further you'll need to understand the structure of data.(Note: data representation and holder,serialization etc. is UP for discussion but not the structure itself) For better visualization I'll show the concept on the Dictionary:
Dictionary<Tuple<string, string, string>, Dictionary<string, string>>
- So the Tuple values are like three equally important strings which should be loaded all at once from file (I know that things I'm going to talk about further are not exactly how they work, but as I've already said that^ Dictionary is just for the visualization and ease of explanation, data management is UP for suggestions).
- User will be granted with 3 search textboxes and he should be able to search through any of those 3 or all at once and view the results in a form of a table/list (I know, I know that for now dataset looks like the thing to go, but I wouldn't ask your help if everything was so simple). At this point the user should be able to create new KeyValue pair for that^ dictionary and save the result back so that it will be decrypted and file appended/overwritten or written if new.
- Now when user is happy with result he can select the thing he needs and proceed - now for that selected Key all Value's Keys are loaded from encrypted file but its respective Values aren't. All those Keys are represented in some sort of a list.
Now once again user can scroll through it select the Key and press one of 4 buttons:
Delete - removes Key and Value but remain the Tuple.
Copy - just loads the respective Value from file and puts it in clipboard.
Edit - loads the respective Value and allows to edit both Key and Value.
New - create new KeyValue pair.
At any given time user can press save and it saves current state to encrypted file. Or save as to the other file(so in this case instead of fetching all values it should copy that file and modify it).
- User can go back and forth adding and modifying values.
- When user is happy with result he closes app and yay wall of text ended.
And also should I store all loaded values in a secure strings or there is something better? (so that it can't be read from memory by some third party program, I have developed in past some sort of security preventing calls to app or injections but still - secure string or something else?).
Thanks to all who'll read up to this part anyway. If you have any questions or didn't understood some part of my question - let me know, I'll try to elaborate or explain it better, thanks again.
Edit 1: Okay Alex I'll try to make tl/dr for you:
Part 1 - what way should I partially decrypt then deserialize some chunk of Data from file and then on need fetch the other values from file and on need save changes/additions back. Recommend anything.
Part 2 - best way to protect loaded data in memory from third party apps.