BigNerd95 / RouterOS-Backup-Tools

Tools to encrypt/decrypt and pack/unpack RouterOS v6.13+ backup files
GNU Lesser General Public License v3.0
280 stars 101 forks source link

Error running script on CentOS #6

Closed CCNST closed 6 years ago

CCNST commented 6 years ago

Hi,

when I try to run the script on Centos with Python 3.4.8 I get the following errors:

Backup Info RouterOS Encrypted Backup ('Length:', 452587, 'bytes') Traceback (most recent call last): File "./ROSbackup.py", line 426, in main() File "./ROSbackup.py", line 413, in main info(args.input) File "./ROSbackup.py", line 204, in info print("Salt (hex):", salt.hex())

The installed Python packages are the following ones:

Package Version


certifi 2018.8.13 chardet 3.0.4 cipher 0.1 configobj 5.0.6 crypto 1.4.1 decorator 4.3.0 idna 2.7 imageio 2.3.0 iniparse 0.4 lxml 4.2.4 Naked 0.1.31 NeuroTools 0.3.1 numpy 1.15.0 perf 1.5.1 Pillow 5.2.0 pip 18.0 pycrypto 2.6.1 pyudev 0.21.0 PyYAML 3.13 requests 2.19.1 setuptools 40.1.0 shellescape 3.4.1 six 1.11.0 SLIP 20171205 urllib3 1.23 wheel 0.31.1

Does anyone have an idea how to fix this?

Best,

Chris

BigNerd95 commented 6 years ago

Are you sure you copied the entire error message? Please check again

CCNST commented 6 years ago

Forgot the last line, now the full message:

./ROSbackup.py decrypt -i 20180819-1152.backup -o 20180819-1152.backup-plain -p ***

Decrypt Backup RouterOS Encrypted Backup Length: 452587 bytes Traceback (most recent call last): File "./ROSbackup.py", line 426, in main() File "./ROSbackup.py", line 415, in main decrypt(args.input, args.output, args.password) File "./ROSbackup.py", line 225, in decrypt print("Salt (hex):", salt.hex()) AttributeError: 'bytes' object has no attribute 'hex'

When I call this way I get the same output: python3 ROSbackup.py decrypt -i 20180819-1152.backup -o 20180819-1152.backup-plain -p ***

Another error message: ./ROSbackup.py info -i 20180819-1152.backup

Backup Info RouterOS Encrypted Backup Length: 452587 bytes Traceback (most recent call last): File "./ROSbackup.py", line 426, in main() File "./ROSbackup.py", line 413, in main info(args.input) File "./ROSbackup.py", line 204, in info print("Salt (hex):", salt.hex()) AttributeError: 'bytes' object has no attribute 'hex'

BigNerd95 commented 6 years ago

''' The code raises such exception in Python version <= 3.4 because I used the bytes.hex() API that was introduced since Python 3.5. It should work in Python 3.5 and 3.6. ''' So update python3 to a more recent version

CCNST commented 6 years ago

Thank you very much for your help. Installed Python 3.6.5 and now all works fine. Maybe you could put a hint in the README. Great script!