~vomun-developers/anonplus/vomun-trunk

« back to all changes in this revision

Viewing changes to src/setup.py

  • Committer: AJ00200
  • Date: 2011-11-20 19:33:52 UTC
  • Revision ID: git-v1:b25cce8c7619bb5c4fe5bede86fee8a385ef3c48
Changed developer warning message to reflect the fact that we do have encryption now but that it is not perfect.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
        Get it for Linux at https://www.dlitz.net/software/pycrypto/
18
18
        Get it for Windows at http://www.voidspace.org.uk/python/modules.shtml#pycrypto
19
19
    ''')
20
 
 
 
20
    
21
21
# Check PyCrpyto version basics - require v2.1.x or higher
22
22
if Crypto.version_info[0] < 2 or Crypto.version_info[1] < 1:
23
23
    raise libs.errors.DependancyError(
27
27
# Find local variables
28
28
print('[*] Preparing for setup...')
29
29
HOME = os.path.expanduser('~')
30
 
VOMUN_PATH = os.path.join(HOME, '.vomun', '')
 
30
VOMUN_PATH = os.path.join(HOME, '.vomun')
31
31
KEYS_PATH = os.path.join(VOMUN_PATH, 'keys.json')
32
32
CONFIG_PATH = os.path.join(VOMUN_PATH, 'config.json')
33
33
 
53
53
print('     this could take a while...')
54
54
 
55
55
# ####################################
56
 
# Generate the node-key for the user
 
56
# TODO: do non-symbolic key generation
57
57
# ####################################
58
 
try:
59
 
    keys['nodekey'] = Crypto.PublicKey.RSA.generate(2048)
60
 
    keys['nodekey'].hash = hashlib.sha256(
61
 
            keys['nodekey'].publickey().exportKey()).hexdigest()
62
 
except AttributeError:
63
 
    pass # Waiting for input from the PyCrypto people
 
58
keys['nodekey'] = Crypto.PublicKey.RSA.generate(2048)
 
59
keys['nodekey'].hash = hashlib.sha256(
 
60
        keys['nodekey'].publickey().exportKey()).hexdigest()
64
61
 
65
62
print('  [*] Done. Key fingerprint:')
66
63
print('      %s' % keys['nodekey'].hash)
71
68
print('     this could take a while...')
72
69
 
73
70
# ####################################
74
 
# Generate the user-key for the user
 
71
# TODO: do non-symbolic key generation
75
72
# ####################################
76
73
keys['userkey'] = Crypto.PublicKey.RSA.generate(2048)
77
74
keys['userkey'].hash = hashlib.sha256(
123
120
        friendlistr = open(friendlistpath, "w")
124
121
        friendlistr.write('[]')
125
122
        friendlistr.close()
126
 
 
 
123
        
127
124
## Setup complete
128
125
print(' == Setup Complete ==')
129
126
print('''