Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Data File Encryption #90

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

Data File Encryption #90

wants to merge 29 commits into from

Conversation

ybhvf
Copy link

@ybhvf ybhvf commented Jan 4, 2014

I've tackled issue #66.

These commits add a class Profile, responsible for saving/loading/encrypting a given Tox Messenger. The file format used is described here (it's loosely based on Toxic's design). I've also created a quick-and-dirty branch that shows Profile in use.

ybhvf added 13 commits December 24, 2013 12:34
This commit adds scrypt-jane as a submodule, and incorporates it source
into the project.

In order to have properly encrypted data files, we need to incorporate
some form of key-derivation. Writing one's own is usually dangerous, and
sodium doesn't provide that sort of functionality, so adding a second
crypto dependency makes sense here.
Salsa20/8 & sha256 are the default mixer/hash for most scrypt
implementations. It makes sense to keep this file format in line with
the de facto standards, in case any other clients want interoperability.
This commit adds the Core::Profile class, which manages the
saving/loading of tox messengers. The files it creates contain an
encrypted copy of the given tox messenger, as well as some information
about the saved 'profile' (a name, saved date, and scrypt/nacl key
parameters).
This commit moves the Profile class out of Core, and simplifies its
functions.

Having the Profile class encapsulated within Core was visibly becoming a
poor decision - it was going to create problems in the longer run with
the login dialog. As such, this commit moves it to its own top-level
file. Profile has also been simplified to work just with the Tox
Messenger save data, and no longer with actual Tox instances & the
tox_load/save() functions.
Conflicts:
	projectfiles/QtCreator/TOX-Qt-GUI.pro
The saveData() & loadData() functions each contained minor bugs
introduced when Profile was moved out of Core.
@nurupo nurupo mentioned this pull request Jan 5, 2014
@ybhvf
Copy link
Author

ybhvf commented Jan 9, 2014

I've moved much of the code for tox messenger saving into a separate repo, as @irungentoo suggested. Profile has been kept as a Qt wrapper for the new tox_data functions, which I think will be handy when implementing #65 & #67.

@nurupo
Copy link
Owner

nurupo commented Jan 9, 2014

Qt doesn't like exceptions, so we write exception-less code.

ybhvf added 5 commits January 9, 2014 22:34
This commit adds a Profile::brokenProfile() function that handles
constructor errors without exceptions.
This commit changes Profile behavior to use tox_load/save() itself.
ybhvf added 2 commits January 9, 2014 23:26
The use of tmpnam() was generating "the use of tmpnam is dangerous"
warnings. This commit switches to a Qt-based solution for a random file
name.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants