diff --git a/.travis.yml b/.travis.yml index 4547f47..f65db78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ branches: - master python: - - "2.7" - "3.4" + - "3.9" addons: apt: diff --git a/LICENSE b/LICENSE index 4c60d35..2074573 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016-2017, Jan Varho +Copyright (c) 2016-2020, Jan Varho Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/Makefile b/Makefile index 7da6c0b..0721daa 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,10 @@ -testall: - python2 rencfs-test.py - python3 rencfs-test.py - test: - python rencfs-test.py + python3 rencfs-test.py coveralls: - python -m coverage run --branch rencfs-test.py + python3 -m coverage run --branch rencfs-test.py coverage: - python -m coverage run --branch rencfs-test.py - python -m coverage report --include=rencfs.py - python -m coverage html --include=rencfs.py + python3 -m coverage run --branch rencfs-test.py + python3 -m coverage report --include=rencfs.py + python3 -m coverage html --include=rencfs.py diff --git a/README b/README index b61692b..6175a4e 100644 --- a/README +++ b/README @@ -12,7 +12,7 @@ Installation: --- Requires: -* Python 2.7 or 3.4+ +* Python 3.4+ * fusepy, e.g. `pip install fusepy` One of: diff --git a/aes.py b/aes.py old mode 100644 new mode 100755 index aaa0115..28398da --- a/aes.py +++ b/aes.py @@ -1,6 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/python3 -# Copyright (c) 2017, Jan Varho +# Copyright (c) 2017-2020, Jan Varho # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -65,3 +65,10 @@ def pycrypto_aes_ctr(key, index): pycrypto_aes_ecb(b'\1'*16) aes_ecb = pycrypto_aes_ecb aes_ctr = pycrypto_aes_ctr + +if __name__ == '__main__': #pragma no cover + a = aes_ecb(b'\1'*16).encrypt(b'\0'*16) + b = aes_ctr(b'\1'*16, 0).encrypt(b'\0'*16) + c = aes_ctr(b'\1'*16, 1).encrypt(b'\0'*16) + assert a == b + assert a != c diff --git a/rencfs-test.py b/rencfs-test.py old mode 100644 new mode 100755 index e261fec..2ede28d --- a/rencfs-test.py +++ b/rencfs-test.py @@ -1,6 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/python3 -# Copyright (c) 2016, Jan Varho +# Copyright (c) 2016-2020, Jan Varho # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -17,7 +17,11 @@ import os from os import urandom, R_OK, W_OK, X_OK from unittest import defaultTestLoader, TestCase, TestSuite, TextTestRunner -from fuse import FuseOSError + +try: + from fusepy import FUSE, FuseOSError, Operations +except ImportError: + from fuse import FUSE, FuseOSError, Operations from rencfs import RencFSEncrypt, RencFSDecrypt diff --git a/rencfs.py b/rencfs.py index e5226ca..8786dcc 100755 --- a/rencfs.py +++ b/rencfs.py @@ -1,6 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/python3 -# Copyright (c) 2016-2017, Jan Varho +# Copyright (c) 2016-2020, Jan Varho # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -27,12 +27,15 @@ from base64 import b16encode from hashlib import sha256 -from fuse import FUSE, FuseOSError, Operations +try: + from fusepy import FUSE, FuseOSError, Operations +except ImportError: + from fuse import FUSE, FuseOSError, Operations from aes import aes_ctr, aes_ecb -__version__ = '0.6' +__version__ = '0.7' BLOCK_MASK = 15 BLOCK_SIZE = 16