Browse Source

add pbkdf2 dependency

283
ThomasV 11 years ago
parent
commit
31226b8a34
  1. 10
      electrum
  2. 28
      lib/bitcoin.py
  3. 2
      setup.py

10
electrum

@ -26,16 +26,6 @@ import sys
import time import time
import traceback import traceback
try:
import ecdsa # todo: 'ecdsa' imported but unused
except ImportError:
sys.exit("Error: python-ecdsa does not seem to be installed. Try 'sudo pip install ecdsa'")
try:
import aes # todo: 'aes' imported but unused
except ImportError:
sys.exit("Error: AES does not seem to be installed. Try 'sudo pip install slowaes'")
is_local = os.path.dirname(os.path.realpath(__file__)) == os.getcwd() is_local = os.path.dirname(os.path.realpath(__file__)) == os.getcwd()
is_android = 'ANDROID_DATA' in os.environ is_android = 'ANDROID_DATA' in os.environ

28
lib/bitcoin.py

@ -17,12 +17,34 @@
# 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 <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import hashlib
import hashlib, base64, ecdsa, re import base64
import re
import sys
import hmac import hmac
import aes
try:
import ecdsa
except ImportError:
sys.exit("Error: python-ecdsa does not seem to be installed. Try 'sudo pip install ecdsa'")
try:
import aes
except ImportError:
sys.exit("Error: AES does not seem to be installed. Try 'sudo pip install slowaes'")
try:
import pbkdf2
except ImportError:
sys.exit("Error: pbkdf2 does not seem to be installed. Try 'sudo pip install pbkdf2'")
from util import print_error from util import print_error
# AES encryption # AES encryption
EncodeAES = lambda secret, s: base64.b64encode(aes.encryptData(secret,s)) EncodeAES = lambda secret, s: base64.b64encode(aes.encryptData(secret,s))
DecodeAES = lambda secret, e: aes.decryptData(secret, base64.b64decode(e)) DecodeAES = lambda secret, e: aes.decryptData(secret, base64.b64decode(e))

2
setup.py

@ -56,7 +56,7 @@ data_files += [
setup( setup(
name="Electrum", name="Electrum",
version=version.ELECTRUM_VERSION, version=version.ELECTRUM_VERSION,
install_requires=['slowaes', 'ecdsa>=0.9'], install_requires=['slowaes', 'ecdsa>=0.9', 'pbkdf2'],
package_dir={ package_dir={
'electrum': 'lib', 'electrum': 'lib',
'electrum_gui': 'gui', 'electrum_gui': 'gui',

Loading…
Cancel
Save