Skip to content

Commit c01ec91

Browse files
committed
fix format string
1 parent 0410f90 commit c01ec91

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "xortool"
3-
version = "1.0.0"
3+
version = "1.0.2"
44
description = "A tool to analyze multi-byte xor cipher"
55
authors = ["hellman"]
66
license = "MIT"

‎xortool/tool_main.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,10 @@ def produce_plaintexts(ciphertext, keys, key_char_used):
392392
perc_mapping.close()
393393

394394
fmt = "Found {C_COUNT}{:d}{C_RESET} plaintexts with {C_COUNT}{:d}{C_RESET}%+ valid characters"
395+
msg = fmt.format(count_valid, round(threshold_valid), **COLORS)
395396
if PARAMETERS["known_plain"]:
396-
fmt += " which contained '{}'".format(PARAMETERS["known_plain"].decode('ascii'))
397-
print(fmt.format(count_valid, round(threshold_valid), **COLORS))
397+
msg += " which contained '{}'".format(PARAMETERS["known_plain"].decode('ascii'))
398+
print(msg)
398399
print("See files {}, {}".format(fn_key_mapping, fn_perc_mapping))
399400

400401

0 commit comments

Comments
 (0)