From 8992f1b92f22d3229f003148619f7c2c6e2c7a26 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Mon, 15 Apr 2019 22:39:32 -0400 Subject: [PATCH 01/55] Added decoding example of Hello World Under tests section: > Example Test string encoding: - Decode Target: `hello world - Each letter decodes to respective 6-bit group: `"010001","001110","010101","010101","011000"," ", "100000","011000","011011","010101","001101", - Each Word as Continous string `"010001001110010101010101011000" "100000011000011011010101001101" - Concatenation of both words into one string: `"010001001110010101010101011000100000011000011011010101001101" - Converted binary string to hex: `0x44e55562061b54d` --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 3c3632f..1e5088f 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,18 @@ Python 3 or higher ## Tests: +> Example Test string encoding: + +- Decode Target: `hello world + +- Each letter decodes to respective 6-bit group: `"010001","001110","010101","010101","011000"," ", "100000","011000","011011","010101","001101", + +- Each Word as Continous string `"010001001110010101010101011000" "100000011000011011010101001101" + +- Concatenation of both words into one string: `"010001001110010101010101011000100000011000011011010101001101" + +- Converted binary string to hex: `0x44e55562061b54d` + ## Reources: ## Roadmap/Plans: From 136976b9a632b399a49f8eea02ff476bc892f35c Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 16 Apr 2019 11:11:37 -0400 Subject: [PATCH 02/55] Update README.md --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1e5088f..9024c86 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Hatnotation -> Hatnotation is short for the *Hatzakis Base 64 notation system* which is a method to encode/decode arbitrary binary strings of data, invented by Steven Hatzakis and open-sourced here under Apache License 2.0 https://github.com/hatgit/hatnotation/blob/master/LICENSE. +> Hatnotation is short for the *Hatzakis Base 64 notation system* which is a method to encode/decode arbitrary binary strings of data, invented by Steven Hatzakis and open-sourced here under [Apache License 2.0](https://github.com/hatgit/hatnotation/blob/master/LICENSE).
-
[Use of Hatnotation is subject to Apache License 2.0 ] https://github.com/hatgit/hatnotation/blob/master/LICENSE
+
[Use of Hatnotation is subject to Apache License 2.0] https://github.com/hatgit/hatnotation/blob/master/LICENSE
 
@@ -17,7 +17,7 @@ This software is still in its experimental phase and should not be relied upon f ## Background on Mnemonics (private keys) and Human vs Machine-readable code -Mnemonics (aka recovery phrases) are used in many popular crypto wallet applciations including BIP39 (which follows a specific wordlist and checksum requirement, among other steps for wallet derivation such as BIP32, BIP44) enable a user to backup their initial entropy in human-readable format. +Mnemonics (aka recovery phrases) are used in many popular crypto wallet applciations including [BIP39 (https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) (which follows a specific wordlist and checksum requirement, among other steps for wallet derivation such as BIP32, BIP44) enable a user to backup their initial entropy in human-readable format. For example, instead of a user having to backup a string of 128 bits or their private key, they can simply store the encoded mnemonic which represents those bits or a private key. @@ -32,7 +32,7 @@ For example, instead of a user having to backup a string of 128 bits or their pr |Total Words |`132/11 = 12 words` |`264/11 = 24 words` | |----------------|-------------------------------|-----------------------------| -In terms of actual pre-image resistance, the initial entropy should be generated in a cryptographically-secure manner that is pre-image resistant and resistant to other attacks, such as outlined in the W3C Cryptography API or via the "secrets" module in Python), and the psuedo-random binary string that results will be that is machine-readable where the purpose of encoding it into a mnemonic is to make it easier to notate, recite, read, and write, compared to binary (machine-readable). +In terms of actual pre-image resistance, the initial entropy should be generated in a cryptographically-secure manner that is pre-image resistant and resistant to other attacks, such as outlined in the [W3C Cryptography API](https://www.w3.org/TR/WebCryptoAPI/) or via the [secrets](https://docs.python.org/3/library/secrets.html) module in Python), and the psuedo-random binary string that results will be machine-readable where the purpose of encoding it into a mnemonic is to make it easier to notate, recite, read, and write, (i.e. human-readable) compared to binary (machine-readable). @@ -62,15 +62,18 @@ The Hatnotation system is *not intended to be an alternative to human-readable m Just as a mnemonic that represents a 132 bits of some initial entropy should convey 128 bits of security if generated properly, as the last 4 bits are deterministically derived from the hash-based checksum computation (hashing the initial entropy as a byte array). Those same 132 bits can be encoded using the Hatnotation system which will result in 22 characters, sourced from the 64 character library. Mathematically, 64^22 == 2^132, hence why there is no information/security loss, for example. ### Lemma -For any arbitrary binary (base-2) string x of length n, after hatnotation is applied to x, the length n = ((x - (x % 6))/6)+(x %6, optionally in some cases depending on how the encoder/decoder is constructed). Optimal compression will occur when the [COMPLETE THIS SECTION] +For any arbitrary binary (base-2) string x of length n, after hatnotation is applied to x, the length n = ((x - (x % 6))/6)+(x %6, optionally in some cases depending on how the encoder/decoder is constructed). -- `(128-(128 % 6)) / 6 == 21 == 2^128` -- `(132-(132 % 6)) / 6 == 22 == 2^132` -- `(256-(256 % 6)) / 6 == 42 == 2^256` -- `(264-(264 % 6)) / 6 == 44 == 2^264` +Optimal compression will occur when the x modulo 6 is equal to zero, and least optimum when x modulo 6 is equal to 5 (The assumption in this last sentence should be checked). +Below are two examples of when notation is optimum, using 132 bits and 264 bits as an example, and which are standard bit-lengths for the underlying entropy that represents 12-word or 24-word mnemonics used with crypto wallets. -| Private Key |12-word mnemonic |24-word mnemonic | +- `(64^((132-(132 % 6)) / 6) == 2^132` + +- `(64^((264-(264 % 6)) / 6) == 2^264` + + +| Private Key |Length after Hatnotation | BIP39 checksum | |----------------|-------------------------------|-----------------------------| | 128 bits |21 characters |Checksum must be computed | | 132 bits |22 characters |Checksum included | From c98db0b9bfa8801b256e9f585e87e9891dfaab7d Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 16 Apr 2019 11:12:02 -0400 Subject: [PATCH 03/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9024c86..a118590 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## Purpose -An encoding/decoding method that allows users to compress their human-readable data into fewer humand-readable characters than other popular notation systems, for any arbitrary underlying machine-readable binary string. +An encoding/decoding method that allows users to compress their human-readable data into fewer human-readable characters than other popular notation systems, for any arbitrary underlying machine-readable binary string. ## Warning: From e6cebd7f48c471072e0aeb236fac8fdbbbc9b75a Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 16 Apr 2019 11:15:10 -0400 Subject: [PATCH 04/55] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a118590..0ed8ffa 100644 --- a/README.md +++ b/README.md @@ -177,9 +177,9 @@ Python 3 or higher ## Tests: -> Example Test string encoding: +> Example Test strings: -- Decode Target: `hello world +- Decode Target: `helloworld - Each letter decodes to respective 6-bit group: `"010001","001110","010101","010101","011000"," ", "100000","011000","011011","010101","001101", @@ -187,10 +187,13 @@ Python 3 or higher - Concatenation of both words into one string: `"010001001110010101010101011000100000011000011011010101001101" -- Converted binary string to hex: `0x44e55562061b54d` +- Converted binary string to hex (can be used as starting point to encode to "helloworld": `0x44e55562061b54d` ## Reources: +-Other base64 encoding schemes: https://en.wikipedia.org/wiki/Base64 +-Notational conventions: https://tools.ietf.org/html/rfc2822 + ## Roadmap/Plans: From 661a2091e286bfd2e231e9893a90d566b1a7b181 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 16 Apr 2019 11:29:17 -0400 Subject: [PATCH 05/55] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ed8ffa..13b10e4 100644 --- a/README.md +++ b/README.md @@ -191,8 +191,8 @@ Python 3 or higher ## Reources: --Other base64 encoding schemes: https://en.wikipedia.org/wiki/Base64 --Notational conventions: https://tools.ietf.org/html/rfc2822 +- Other base64 encoding schemes: https://en.wikipedia.org/wiki/Base64 +- Notational conventions: https://tools.ietf.org/html/rfc2822 ## Roadmap/Plans: From ae43bf4863046efe3dd6c9ba3c1dbc36c16181f6 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 16 Apr 2019 11:36:44 -0400 Subject: [PATCH 06/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13b10e4..1b86fb8 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ Python 3 or higher - Converted binary string to hex (can be used as starting point to encode to "helloworld": `0x44e55562061b54d` -## Reources: +## Resources: - Other base64 encoding schemes: https://en.wikipedia.org/wiki/Base64 - Notational conventions: https://tools.ietf.org/html/rfc2822 From ce54ae34dfaf0656d2fc33c15b7006a912b7baea Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 16 Apr 2019 13:01:41 -0400 Subject: [PATCH 07/55] Fix backslash at index 59 in library not rendering the `\` character wasn't rendering in markup here and also may be an issue to look at in Python decoder. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b86fb8..0aaad27 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ Using the binascii libary in python which contains the string library, we source 56 | "111000", | "?", 57 | "111001", | "@", 58 | "111010", | "[", -59 | "111011", | "\", +59 | "111011", | "\\", 60 | "111100", | "]", 61 | "111101", | "^", 62 | "111110", | "_", From 379197e06b2d2e2569f4ad2d2d92cd89c03232a1 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 16 Apr 2019 13:45:01 -0400 Subject: [PATCH 08/55] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 0aaad27..0afd71a 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,10 @@ Python 3 or higher - Converted binary string to hex (can be used as starting point to encode to "helloworld": `0x44e55562061b54d` + +Second Test: Decoder should be able to take a single backslash `\` and return index value 59, as well as multiple ones '`\\\\\`' and not be affected by any formatting/rendering issues of the app or interface (i.e. python or javascript/html). + + ## Resources: - Other base64 encoding schemes: https://en.wikipedia.org/wiki/Base64 @@ -196,4 +200,6 @@ Python 3 or higher ## Roadmap/Plans: +- develop a range of potential use cases +- potentially propose a request for comments (RFC) for consideration as a standard. From cf9a5d4822e66c2b7e750ad86d1b840ab562ab41 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 16 Apr 2019 15:45:40 -0400 Subject: [PATCH 09/55] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0afd71a..9a45d31 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ Second Test: Decoder should be able to take a single backslash `\` and return in - Other base64 encoding schemes: https://en.wikipedia.org/wiki/Base64 - Notational conventions: https://tools.ietf.org/html/rfc2822 +- Human-readable keys (1994) https://tools.ietf.org/html/rfc1751 ## Roadmap/Plans: From 3f0b0fdf15f326d29103ba043410576f44ab9178 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Wed, 17 Apr 2019 01:17:41 -0400 Subject: [PATCH 10/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a45d31..7745ba4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ An encoding/decoding method that allows users to compress their human-readable d ## Warning: -This software is still in its experimental phase and should not be relied upon for production. +This software is still in its experimental phase and should not be relied upon for production. ## Background on Mnemonics (private keys) and Human vs Machine-readable code From bab9cd7b6719d6de38253c9f674361722bf224f4 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Wed, 17 Apr 2019 23:01:35 -0400 Subject: [PATCH 11/55] Updated library with new characters and added note the backslash `\` and forwadslash `/`characters were swapped with opening `{` and closing `}` curly brackets in the following issue: https://github.com/hatgit/hatnotation/issues/3 --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7745ba4..4fea1a6 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ Using the binascii libary in python which contains the string library, we source 47 | "101111", | ",", 48 | "110000", | "-", 49 | "110001", | ".", -50 | "110010", | "/", +50 | "110010", | "{", 51 | "110011", | ":", 52 | "110100", | ";", 53 | "110101", | "<", @@ -151,7 +151,7 @@ Using the binascii libary in python which contains the string library, we source 56 | "111000", | "?", 57 | "111001", | "@", 58 | "111010", | "[", -59 | "111011", | "\\", +59 | "111011", | "}", 60 | "111100", | "]", 61 | "111101", | "^", 62 | "111110", | "_", @@ -159,14 +159,17 @@ Using the binascii libary in python which contains the string library, we source ## Library verification -In Python version 3.7 using the strings library, the following steps can be taken to verify the library and character order and by omitting the last 4 characters "{|}~" in the fourth step below (zeroed-index values 64-67 which have been omitted from the above list as well): +In Python version 3.7 using the strings library, the following steps can be taken to verify the library and character order and notice that the following 4 characters are omitted "\\~/|" in the fourth step below: - ```>>> import string``` - ```>>> dir(string)['Formatter', 'Template', '_ChainMap', '_TemplateMetaclass', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_re', '_string', 'ascii_letters', 'ascii_lowercase', 'ascii_uppercase', 'capwords', 'digits', 'hexdigits', 'octdigits', 'printable', 'punctuation', 'whitespace']``` - ```>>> print(string.digits+string.ascii_uppercase+string.punctuation)``` - ```0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~``` -(i.e. ~~```"{|}~"```~~) +- Note, the backslash `\` and forwadslash `/`characters were swapped with opening `{` and closing `}` curly brackets in the following issue: https://github.com/hatgit/hatnotation/issues/3. +- The list of valid Hatnotation library characters are thus as follows: ```0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.{:;<=>?@[}]^_```` + +(and the following four remain excluded/reserved ~~```"\/|~"```~~). ## Requirements @@ -179,7 +182,7 @@ Python 3 or higher > Example Test strings: -- Decode Target: `helloworld +- Decode Target: `HELLOWORLD - Each letter decodes to respective 6-bit group: `"010001","001110","010101","010101","011000"," ", "100000","011000","011011","010101","001101", @@ -203,4 +206,5 @@ Second Test: Decoder should be able to take a single backslash `\` and return in - develop a range of potential use cases - potentially propose a request for comments (RFC) for consideration as a standard. +- add error message for invalid characters (i.e. lowercase and reserved characters `\|/~` From 2475c93bd0d40e567869d256d9fd833ca4e1ad8a Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Wed, 17 Apr 2019 23:01:56 -0400 Subject: [PATCH 12/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fea1a6..59e95bb 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ In Python version 3.7 using the strings library, the following steps can be take - ```>>> print(string.digits+string.ascii_uppercase+string.punctuation)``` - ```0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~``` -- Note, the backslash `\` and forwadslash `/`characters were swapped with opening `{` and closing `}` curly brackets in the following issue: https://github.com/hatgit/hatnotation/issues/3. +- Note, the backslash `\` and forwardslash `/`characters were swapped with opening `{` and closing `}` curly brackets in the following issue: https://github.com/hatgit/hatnotation/issues/3. - The list of valid Hatnotation library characters are thus as follows: ```0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.{:;<=>?@[}]^_```` (and the following four remain excluded/reserved ~~```"\/|~"```~~). From 9c16abcbafc3a60dbd2cf749dfceda9b0a9ba153 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Wed, 17 Apr 2019 23:11:26 -0400 Subject: [PATCH 13/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59e95bb..858106a 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ In Python version 3.7 using the strings library, the following steps can be take - ```0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~``` - Note, the backslash `\` and forwardslash `/`characters were swapped with opening `{` and closing `}` curly brackets in the following issue: https://github.com/hatgit/hatnotation/issues/3. -- The list of valid Hatnotation library characters are thus as follows: ```0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.{:;<=>?@[}]^_```` +- The list of valid Hatnotation library characters are thus as follows: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.{:;<=>?@[}]^_` (and the following four remain excluded/reserved ~~```"\/|~"```~~). From 9504bbc563a487849e59e8ceacd9982269a01d0b Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Thu, 18 Apr 2019 21:19:34 -0400 Subject: [PATCH 14/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 858106a..7f6ea43 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Mnemonics (aka recovery phrases) are used in many popular crypto wallet applciat For example, instead of a user having to backup a string of 128 bits or their private key, they can simply store the encoded mnemonic which represents those bits or a private key. -> Note: While the word "private key" is usually associated with public/private key-pairs in cryptogrpahy, for the purpose of this Readme.md file, the use of private key refers to the master private key (initial entropy) for a crypto vault (within which accounts and private keys are dervived) which can also be considered a pre-image of the mnemonic. +> Note: While the word "private key" is usually associated with public/private key-pairs in cryptogrpahy, for the purpose of this Readme.md file, the use of private key refers to the master private key (initial entropy) for a crypto vault (within which accounts and private keys are derived) which can also be considered a pre-image of the mnemonic. | |12-word mnemonic |24-word mnemonic | From 4d7d6918a681f7cf9154474dbc6732313b6a2725 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Thu, 18 Apr 2019 21:22:40 -0400 Subject: [PATCH 15/55] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 7f6ea43..5568630 100644 --- a/README.md +++ b/README.md @@ -193,8 +193,6 @@ Python 3 or higher - Converted binary string to hex (can be used as starting point to encode to "helloworld": `0x44e55562061b54d` -Second Test: Decoder should be able to take a single backslash `\` and return index value 59, as well as multiple ones '`\\\\\`' and not be affected by any formatting/rendering issues of the app or interface (i.e. python or javascript/html). - ## Resources: From 66727918cef8a5bdfad21051d52b9c1e483c7fbc Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Thu, 25 Apr 2019 11:51:46 -0400 Subject: [PATCH 16/55] corrected formatting of message so that "'" shows On the line: hatdata2decode=input The formatting of the string was corrected thanks to a fix by @PumpkingWok --- base64Decode_v1_01.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base64Decode_v1_01.py b/base64Decode_v1_01.py index 16ee090..d145f3c 100644 --- a/base64Decode_v1_01.py +++ b/base64Decode_v1_01.py @@ -101,7 +101,7 @@ def decodeAsHex(string): return hex(int(decodeAsBin(string), 2)) -hatdata2decode=input('Enter any combination of the following characters to decode without spaces: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&''()*+,-.{:;<=>?@[}]^_`":') +hatdata2decode=input('Enter any combination of the following characters to decode without spaces: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"'"#$%&'"'()*+,-.{:;<=>?@[}]^_`:') print(decodeAsBin(hatdata2decode)) From 0aebb891b95cc601601d0cd0a9a5e71ad6fc9f88 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Thu, 25 Apr 2019 17:46:03 -0400 Subject: [PATCH 17/55] fixed "+" to '+' to avoid print formatting issues --- base64Decode_v1_01.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base64Decode_v1_01.py b/base64Decode_v1_01.py index d145f3c..e3bb203 100644 --- a/base64Decode_v1_01.py +++ b/base64Decode_v1_01.py @@ -63,7 +63,7 @@ "(", ")", "*", -"+", +'+', ",", "-", ".", From 61ccac1170f5737027cb612225a5b96cecddf5ca Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Thu, 25 Apr 2019 17:49:20 -0400 Subject: [PATCH 18/55] fixed "+" to '+' to avoid format issues printing --- base64encode_v1_01.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base64encode_v1_01.py b/base64encode_v1_01.py index 3363b34..28f7e78 100644 --- a/base64encode_v1_01.py +++ b/base64encode_v1_01.py @@ -65,7 +65,7 @@ def base64en(address_hex): # important never to rename base64en to "base64" wh "(", ")", "*", -"+", +'+', ",", "-", ".", From 90da18094347ad3610c65e4c5c0ed7f916633995 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Thu, 25 Apr 2019 17:51:14 -0400 Subject: [PATCH 19/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5568630..75661d0 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ Using the binascii libary in python which contains the string library, we source 43 | "101011", | "(", 44 | "101100", | ")", 45 | "101101", | "*", -46 | "101110", | "+", +46 | "101110", | '+', 47 | "101111", | ",", 48 | "110000", | "-", 49 | "110001", | ".", From 937ca794a313870ecce8229054e799533c5dd95b Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Thu, 25 Apr 2019 17:53:02 -0400 Subject: [PATCH 20/55] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 75661d0..ee8da47 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,13 @@ In Python version 3.7 using the strings library, the following steps can be take (and the following four remain excluded/reserved ~~```"\/|~"```~~). + +The following Hex string can be fed to the encoder to print all characters in order except for the first which is "0" (zero) and gets omitted: 0x108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31ef3d35db7e39eb2f3dfbf + +The loss of leading zeroes has been discussed in the following issue and is common across notation systems when converting from padded binary data: https://github.com/hatgit/hatnotation/issues/6 + +** There can be some formatting issues in Python which affect how data is printed as noted in this committ: https://github.com/hatgit/hatnotation/commit/66727918cef8a5bdfad21051d52b9c1e483c7fbc + ## Requirements Python 3 or higher From 3f3246ab9056b82214631d8be5dcf19acd453a8b Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Fri, 26 Apr 2019 22:43:10 -0400 Subject: [PATCH 21/55] Update README.md Added hat emoji to H1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee8da47..215466a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Hatnotation +# :tophat: Hatnotation > Hatnotation is short for the *Hatzakis Base 64 notation system* which is a method to encode/decode arbitrary binary strings of data, invented by Steven Hatzakis and open-sourced here under [Apache License 2.0](https://github.com/hatgit/hatnotation/blob/master/LICENSE). From 80a13fb773321c41bec831b1b349044321962e20 Mon Sep 17 00:00:00 2001 From: andrea zuccarini Date: Sat, 27 Apr 2019 12:16:13 +0200 Subject: [PATCH 22/55] add decode js file --- base64Decode_v1_01.js | 125 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 base64Decode_v1_01.js diff --git a/base64Decode_v1_01.js b/base64Decode_v1_01.js new file mode 100644 index 0000000..95b8fc0 --- /dev/null +++ b/base64Decode_v1_01.js @@ -0,0 +1,125 @@ +//Author: Andrea Zuccarini @2019 + +//Version 1.01 + +// Example Test string target to decode: HELLOWORLD +// Each letter decodes to respective 6-bit group: "010001","001110","010101","010101","011000"," ", "100000","011000","011011","010101","001101", +// Each Word as Continous string "010001001110010101010101011000" "100000011000011011010101001101" +// Concatenation of both words into one string: "010001001110010101010101011000100000011000011011010101001101" +// Converted binary string to hex: "0x44e55562061b54d" + + +b64dict= {}; + +base64library=['0', +'1', +'2', +'3', +'4', +'5', +'6', +'7', +'8', +'9', +'A', +'B', +'C', +'D', +"E", +'F', +'G', +'H', +'I', +'J', +'K', +'L', +'M', +'N', +'O', +'P', +'Q', +'R', +'S', +'T', +'U', +'V', +'W', +'X', +'Y', +'Z', +'!', +'"', +'#', +'$', +'%', +'&', +"'", +'(', +')', +'*', +'+', +',', +'-', +'.', +'}', +':', +';', +'<', +'=', +'>', +'?', +'@', +'[', +'{', +']', +'^', +'_', +'`']; + +for(var i=0;i?@[}]^_`:'); +console.log(decodeAsBin('HELLOWORLD')); +console.log('0x' + decodeAsHex('HELLOWORLD')); + + +// test decode string "HELLOWORLD" should return the binary equivalent of hex: 0x44e55562061b54d +// test decode string "INVENTEDBYSTEVENHATZAKIS@2018" should return this hex 0x125df39774e34b89c74e7ce5d129d8ca512739080048 as equivalent in binary to this output: 010010010111011111001110010111011101001110001101001011100010011100011101001110011111001110010111010001001010011101100011001010010100010010011100111001000010000000000001001000 + +// Note/CONSIDERATION: In version 1.01 to resolve a rendering conflict, the Forward slash "/" and Backslash "\" characters have been swapped out and replaced by the closing curly bracket "}" and opening curly bracket "{" on purpose. From f4e7eb7462aac20a2565b41be936ed3d242dd88f Mon Sep 17 00:00:00 2001 From: andrea zuccarini Date: Sat, 27 Apr 2019 19:52:19 +0200 Subject: [PATCH 23/55] add encode js file --- base64encode_v1-01.js | 96 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 base64encode_v1-01.js diff --git a/base64encode_v1-01.js b/base64encode_v1-01.js new file mode 100644 index 0000000..5b9add6 --- /dev/null +++ b/base64encode_v1-01.js @@ -0,0 +1,96 @@ +//Author: Andrea Zuccarini @2019 +// Version 1.01 + +//test binary data string: 0b010010010111011111001110010111011101001110001101001011100010011100011101001110011111001110010111010001001010011101100011001010010100010010011100111001000010000000000001001000 + +//test string as hex: '0x125df39774e34b89c74e7ce5d129d8ca512739080048' + +//test string result :'INVENTEDBYSTEVENHATZAKIS@2018' + +// legacy notes: #FIX: LEADING ZEROS LOST (i.e.w/ test string 0x064ce8c835f4d374e04e33244beccad0) +// also, even when no leading zero in string, the leading zeroes of the actual base64 character are discarded, +// as the encoding appears to happen from right to left, see this test string where leading zeroes of +// first char 2 are discarded, and last char is N 0xb13ae7e331ce9dfa59799e95ee8dc117 + +function base64en(address_hex) { // important never to rename base64en to "base64" which can corrupt the Python installation. + // (renamed alphabet to base64library below) alphabet = string.digits+string.ascii_uppercase+string.punctuation + base64library=["0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "!", + '"', + "#", + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "{", + ":", + ";", + "<", + "=", + ">", + "?", + "@", + "[", + "}", + "]", + "^", + "_", + "`"] + b64_string = ''; + // Convert hex to decimal + address_int = parseInt(address_hex,16); + // Append digits to the start of string + while(address_int > 0) { + digit = address_int % 64; + digit_char = base64library[digit]; + b64_string = digit_char + b64_string; + address_int = parseInt(address_int/64); + } + return b64_string; +} +//hexer=input('enter hex with pad'); +hexer = '0x125df39774e34'; +console.log(base64en(hexer)); +console.log("The above is this many char's long: ", base64en(hexer).length); From 4a51031b195cc41524815e298fc4ac6e920c91d4 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Sat, 27 Apr 2019 15:19:37 -0400 Subject: [PATCH 24/55] Update README.md --- README.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 215466a..9439738 100644 --- a/README.md +++ b/README.md @@ -169,14 +169,9 @@ In Python version 3.7 using the strings library, the following steps can be take - Note, the backslash `\` and forwardslash `/`characters were swapped with opening `{` and closing `}` curly brackets in the following issue: https://github.com/hatgit/hatnotation/issues/3. - The list of valid Hatnotation library characters are thus as follows: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.{:;<=>?@[}]^_` -(and the following four remain excluded/reserved ~~```"\/|~"```~~). +- And the following four remain excluded/reserved ~~```"\/|~"```~~). -The following Hex string can be fed to the encoder to print all characters in order except for the first which is "0" (zero) and gets omitted: 0x108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31ef3d35db7e39eb2f3dfbf - -The loss of leading zeroes has been discussed in the following issue and is common across notation systems when converting from padded binary data: https://github.com/hatgit/hatnotation/issues/6 - -** There can be some formatting issues in Python which affect how data is printed as noted in this committ: https://github.com/hatgit/hatnotation/commit/66727918cef8a5bdfad21051d52b9c1e483c7fbc ## Requirements @@ -187,7 +182,7 @@ Python 3 or higher ## Tests: -> Example Test strings: +> Example Test strings (note: these are not ASCII notations): - Decode Target: `HELLOWORLD @@ -197,9 +192,25 @@ Python 3 or higher - Concatenation of both words into one string: `"010001001110010101010101011000100000011000011011010101001101" -- Converted binary string to hex (can be used as starting point to encode to "helloworld": `0x44e55562061b54d` +- Converted binary string to hex (can be used as starting point to encode to "HELLOWORLD": `0x44e55562061b54d` + +The following Hex string can be fed to the encoder to print all characters in their linear order except for the first which is "0" (zero) and gets omitted: 0x108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31ef3d35db7e39eb2f3dfbf + +The easiest of this example can be seen using the Hatnotation library of 64 characters as the input: + +0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.{:;<=>?@[}]^_` +`The library in binary format as a continous string: +000000000001000010000011000100000101000110000111001000001001001010001011001100001101001110001111010000010001010010010011010100010101010110010111011000011001011010011011011100011101011110011111100000100001100010100011100100100101100110100111101000101001101010101011101100101110101111110000110001110010110011110100110101110110110111111000111001111010111011111100111101111110111111 + +(which in hex is: 0x108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31ef3d35db7e39eb2f3dfbf) +which when encoded back to hatnotation loses the leading zero (or first 6 zeroes of the above binary string) resulting in it missing from the start of the resulting encoded characters: "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.}:;<=>?@[{]^_`" + + +The loss of leading zeroes has been discussed in the following issue and is common across notation systems when converting from padded binary data: https://github.com/hatgit/hatnotation/issues/6 + +** There can be some formatting issues in Python which affect how data is printed as noted in this committ: https://github.com/hatgit/hatnotation/commit/66727918cef8a5bdfad21051d52b9c1e483c7fbc ## Resources: From a4dc2096b8a9d56bf78852eacbab219ce8aeb958 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Sat, 27 Apr 2019 15:22:10 -0400 Subject: [PATCH 25/55] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9439738..24e0d88 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ Python 3 or higher > Example Test strings (note: these are not ASCII notations): -- Decode Target: `HELLOWORLD +- Decode Target: `HELLOWORLD` - Each letter decodes to respective 6-bit group: `"010001","001110","010101","010101","011000"," ", "100000","011000","011011","010101","001101", From b397e9f9c02bd19786d7a6fa4ae020177e4f02dc Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Sat, 27 Apr 2019 15:27:35 -0400 Subject: [PATCH 26/55] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 24e0d88..d65fac2 100644 --- a/README.md +++ b/README.md @@ -194,21 +194,23 @@ Python 3 or higher - Converted binary string to hex (can be used as starting point to encode to "HELLOWORLD": `0x44e55562061b54d` -The following Hex string can be fed to the encoder to print all characters in their linear order except for the first which is "0" (zero) and gets omitted: 0x108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31ef3d35db7e39eb2f3dfbf +>The following Hex string can be fed to the encoder to print all characters in their linear order except for the first which is "0" (zero) and gets omitted: -The easiest of this example can be seen using the Hatnotation library of 64 characters as the input: +0x108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31ef3d35db7e39eb2f3dfbf + +The easiest of this example can be seen using the Hatnotation library of 64 characters as the input to the decoder: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.{:;<=>?@[}]^_` -`The library in binary format as a continous string: +The library in binary format as a continous string: 000000000001000010000011000100000101000110000111001000001001001010001011001100001101001110001111010000010001010010010011010100010101010110010111011000011001011010011011011100011101011110011111100000100001100010100011100100100101100110100111101000101001101010101011101100101110101111110000110001110010110011110100110101110110110111111000111001111010111011111100111101111110111111 -(which in hex is: 0x108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31ef3d35db7e39eb2f3dfbf) -which when encoded back to hatnotation loses the leading zero (or first 6 zeroes of the above binary string) resulting in it missing from the start of the resulting encoded characters: "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.}:;<=>?@[{]^_`" +The above 384-bit binary string (based on 64*6 bits) in hex is: 0x108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31ef3d35db7e39eb2f3dfbf +When the above hex string is encoded back to hatnotation it loses the leading zero (or first 6 zeroes of the above binary string) resulting in it missing from the start of the resulting encoded characters: "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-.}:;<=>?@[{]^_`" -The loss of leading zeroes has been discussed in the following issue and is common across notation systems when converting from padded binary data: https://github.com/hatgit/hatnotation/issues/6 +The loss of leading zeroes has been discussed in the following issue and is common across other popular notation systems when converting from left-padded binary data: https://github.com/hatgit/hatnotation/issues/6 ** There can be some formatting issues in Python which affect how data is printed as noted in this committ: https://github.com/hatgit/hatnotation/commit/66727918cef8a5bdfad21051d52b9c1e483c7fbc From cc3eb75bcf0cf02dba483c303694c6f59032f8b6 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Sat, 27 Apr 2019 15:35:02 -0400 Subject: [PATCH 27/55] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d65fac2..6cbe302 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ An encoding/decoding method that allows users to compress their human-readable d ## Warning: -This software is still in its experimental phase and should not be relied upon for production. +This software is still in its experimental phase (including debugging, redesign and error-checking/testing) and should not be relied upon for production. ## Background on Mnemonics (private keys) and Human vs Machine-readable code @@ -53,7 +53,7 @@ In terms of actual pre-image resistance, the initial entropy should be generated ## Important -The Hatnotation system is *not intended to be an alternative to human-readable mnemonics*, but rather a complement and simply another representation of the machine-readable code, with the benefit of a reduction in the number of characters needed to notate and backup/store the data, using common and special characters from a library of 64 total possible characters (in range of 2^6). +The Hatnotation system is *not intended to be an alternative to human-readable mnemonics*, but rather a complement and simply another representation of the machine-readable code, with the benefit of a reduction in the number of characters needed to notate and backup/store the data, using common and special characters from a library of 64 total possible characters (in the zero-indexed range of 2^6-1). From 016a6c93b46f3cf96eb5cae4850549f74687ea76 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 30 Apr 2019 11:39:09 -0400 Subject: [PATCH 28/55] Created index.html Html file for use with the Hatnotation encoder and decoder, and using an example BIP39 mnemonic generator from github.com/hatgit/BIP39-Mnemonic-Tools and edits on this gist: https://gist.github.com/johhonn/fea03765fa46280af7dd3563353d0dac --- index.html | 2613 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2613 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..03f8b1a --- /dev/null +++ b/index.html @@ -0,0 +1,2613 @@ + + + BIP39 Mnemonic + + + + + + +

REGULAR: BIP39 Mnemonic Tool

+

STEP 1: Select word count:

+ +

OPTIONAL: Insert entropy in the form of a 0x-padded hex string of length 32 (for 12 words) or 64 (for 24 words):

+ +
+
+ + +
+
+
+

REVERSIBLE: BIP39 Palindromic Mnemonic Tool

+

STEP 1: Select word count:

+ +

OPTIONAL: Insert entropy in the form of a 0x-padded hex string of length 32 (for 12 words) or 64 (for 24 words):

+ +
+
+ + +
+
+
+

Decode Base64 Entropy

+ + +
+
+ + From ec832de11fd2aefd2cc35800c325c21900a78d2b Mon Sep 17 00:00:00 2001 From: johhonn <35551051+johhonn@users.noreply.github.com> Date: Tue, 30 Apr 2019 11:54:37 -0400 Subject: [PATCH 29/55] Update index.html --- index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.html b/index.html index 03f8b1a..9baa10e 100644 --- a/index.html +++ b/index.html @@ -377,6 +377,7 @@ //console.log(hex2) var words=pickWords(entropyWithChecksum) console.log(words) + document.getElementById('result').innerHTML=words } function pickWords(entropyHash) { var result = []; @@ -2608,6 +2609,7 @@

Decode Base64 Entropy


+


From 21681a881502c63a5a584e18119274b4c2e55c89 Mon Sep 17 00:00:00 2001 From: Steven Hatzakis Date: Tue, 30 Apr 2019 11:57:16 -0400 Subject: [PATCH 30/55] Brought bignumber.js inline temporarily --- index.html | 2916 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 2915 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 9baa10e..2da1e6e 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,2921 @@ b){var c={},d;for(d=0;d - + // + +