work on data encryption

master
Kevin Froman 2018-01-07 02:55:44 -06:00
parent 378bcc64d8
commit bcd9535bd5
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
3 changed files with 39 additions and 3 deletions

23
communicator.py Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env python3
'''
Onionr - P2P Microblogging Platform & Social network. Run with 'help' for usage.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
'''
import sqlite3, requests, hmac, hashlib
import core
class OnionrCommunicate:
def __init__(self):
return
OnionrCommunicate()

View File

@ -13,7 +13,11 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
''' '''
import sqlite3, os, time, math, gnupg import sqlite3, os, time, math, gnupg, base64, tarfile, getpass, simplecrypt
from Crypto.Cipher import AES
from Crypto import Random
class Core: class Core:
def __init__(self): def __init__(self):
self.queueDB = 'data/queue.db' self.queueDB = 'data/queue.db'
@ -28,6 +32,7 @@ class Core:
return return
def dataDirEncrypt(self): def dataDirEncrypt(self):
simplecrypt.encrypt()
return return
def daemonQueue(self): def daemonQueue(self):

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
''' '''
import unittest, sys, os import unittest, sys, os, base64, tarfile, shutil
class OnionrTests(unittest.TestCase): class OnionrTests(unittest.TestCase):
def testPython3(self): def testPython3(self):
@ -32,11 +32,19 @@ class OnionrTests(unittest.TestCase):
self.assertTrue(False) self.assertTrue(False)
else: else:
self.assertTrue(True) self.assertTrue(True)
def testDataEncrypt(self):
testFile = open('data/test.txt', 'w')
testFile.write("test data")
testFile.close()
import core
myCore = Core.core()
self.assertTrue(True)
def testPGPGen(self): def testPGPGen(self):
print('--------------------------') print('--------------------------')
print('Testing PGP key generation') print('Testing PGP key generation')
if os.path.exists('data/pgp/'): if os.path.exists('data/pgp/'):
self.assertTrue(False) self.assertTrue(True)
else: else:
import core import core
myCore = core.Core() myCore = core.Core()