Code Monkey home page Code Monkey logo

Comments (6)

noraj avatar noraj commented on June 19, 2024

It must be it.

Python 3

xortool -o -x key.txt                                       
Traceback (most recent call last):
  File "/usr/bin/xortool", line 381, in <module>
    main()
  File "/usr/bin/xortool", line 53, in main
    ciphertext = get_ciphertext()
  File "/usr/bin/xortool", line 96, in get_ciphertext
    ciphertext = decode_from_hex(ciphertext)
  File "/usr/lib/python3.7/site-packages/xortool/routine.py", line 58, in decode_from_hex
    only_hex_digits = "".join([c for c in text if c in string.hexdigits])
  File "/usr/lib/python3.7/site-packages/xortool/routine.py", line 58, in <listcomp>
    only_hex_digits = "".join([c for c in text if c in string.hexdigits])
TypeError: 'in <string>' requires string as left operand, not int

Python 2

xortool -o -x key.txt                                       
The most probable key lengths:
   2:   38.3%
   5:   22.7%
  10:   26.9%
  17:   6.4%
  20:   5.6%
Key-length can be 5*n
100 possible key(s) of length 2:
\n\x15
\x0b\x14
\x08\x17
\t\x16
\x0e\x11
...
Found 50 plaintexts with 95.0%+ printable characters
See files filename-key.csv, filename-char_used-perc_printable.csv

from xortool.

noraj avatar noraj commented on June 19, 2024

Also: with python3.7.2:

$ xortool-xor -h 607b7b7b -h 3f3c3e2f
Traceback (most recent call last):
  File "/usr/bin/xortool-xor", line 117, in <module>
    main()
  File "/usr/bin/xortool-xor", line 40, in main
    v = arg_data(c, val)
  File "/usr/bin/xortool-xor", line 110, in arg_data
    return from_hex(s)
  File "/usr/bin/xortool-xor", line 95, in from_hex
    return res.decode("hex")
AttributeError: 'str' object has no attribute 'decode'

from xortool.

noraj avatar noraj commented on June 19, 2024
$ python2 /usr/bin/xortool-xor -h 607b7b7b -h 3f3c3e2f                                                                                                        
_GET

As @redfast00 spotted, this is totally a matter of shebang.

from xortool.

faan11 avatar faan11 commented on June 19, 2024

possible solution for hex encoding:

def decode_from_hex(text):
    only_hex_digits = "".join([chr(c) for c in text if chr(c) in string.hexdigits])
    return bytes.fromhex(only_hex_digits)

from xortool.

maage avatar maage commented on June 19, 2024

Also #26 fixes this issue.

from xortool.

hellman avatar hellman commented on June 19, 2024

I think should work now on master (not on PyPI yet)

from xortool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.