c# - Serialization to file + encryption + decryption + data management. All in 1 solution -


the question more constructive point , realization i'd grateful example or link example (not theory).

the idea follows:

  1. everything should done locally.
  2. any library whatsoever allowed whole program should portable, , omit fancy things aren't portable.
  3. platform - win7+
  4. completely no size limits.
  5. the safer - better.
  6. wpf.

don't ask why, of above^ must , point.

now closer point itself. program workflow , data management should ~like:

  • user starts obfuscated, single instance, etc. (you can omit in example) wpf exe.
  • user selects file (if exists overwritten on save, if not created on save)(you can omit 1 well).
  • now user provides of data needed encryption (e.g. aes - key , iv)(encryption discussion - let me know 1 think suit me more , why, after reading whole wall of text of course, thanks) , press proceed , read encrypted data file (if file selected).

before going further you'll need understand structure of data.(note: data representation , holder,serialization etc. discussion not structure itself) better visualization i'll show concept on dictionary:

dictionary<tuple<string, string, string>, dictionary<string, string>> 
  • so tuple values 3 equally important strings should loaded @ once file (i know things i'm going talk further not how work, i've said that^ dictionary visualization , ease of explanation, data management suggestions).
  • user granted 3 search textboxes , should able search through of 3 or @ once , view results in form of table/list (i know, know dataset looks thing go, wouldn't ask if simple). @ point user should able create new keyvalue pair that^ dictionary , save result decrypted , file appended/overwritten or written if new.
  • now when user happy result can select thing needs , proceed - selected key value's keys loaded encrypted file respective values aren't. keys represented in sort of list.
  • now once again user can scroll through select key , press 1 of 4 buttons:

    1. delete - removes key , value remain tuple.

    2. copy - loads respective value file , puts in clipboard.

    3. edit - loads respective value , allows edit both key , value.

    4. new - create new keyvalue pair.

  • at given time user can press save , saves current state encrypted file. or save other file(so in case instead of fetching values should copy file , modify it).

  • user can go , forth adding , modifying values.
  • when user happy result closes app , yay wall of text ended.

and should store loaded values in secure strings or there better? (so can't read memory third party program, have developed in past sort of security preventing calls app or injections still - secure string or else?).

thanks who'll read part anyway. if have questions or didn't understood part of question - let me know, i'll try elaborate or explain better, again.

edit 1: okay alex i'll try make tl/dr you:

part 1 - way should partially decrypt deserialize chunk of data file , on need fetch other values file , on need save changes/additions back. recommend anything.

part 2 - best way protect loaded data in memory third party apps.

as can understand, based on comments , downvotes, community welcomes "plain dead simple" questions (like previous one) not constructive , complicated ones. i'm migrating more difficulty-friendly community.

i'll leave 2 solutions (that i've think of) problem ones might looking same problem in future:

1) splitting data chunks , writing/reading plain text/binary file using custom created writer purpose write tuples in separate place demarcation of borders , values other part of file respective positions saved each tuple. it's going complicated that's closest thing come with.

2)if first 1 complicated addition of new values , moving positions of chunks i'll encrypt each string separately , encrypt whole serialized data file can load , on need decrypt needed strings.

as strings in memory - might encrypt them.

if post better solution i'll accept instead (will check tomorrow, if nothing posted till - guess won't check anymore, moderator should feel free accept better answer one). may come other idea i'm surely not gonna update answer anymore.

edit: can't accept answer few days, i'll leave that.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -