jeanpaulrichter / nppcrypt

plugin for notepad++
99 stars 22 forks source link

Base32 conversion faulty #10

Closed 0x6d686b closed 6 years ago

0x6d686b commented 6 years ago

Observed behaviour:

DBCCF06D8A5FB25C53A985C24A2C044C99314D9C -> from hex to base32 -> 5RGRA5NKM83F2W7JSZBEWMAEJUNVCVN6
3PGPA3MKL6ZFYU5JQXBEULAEJSMTCTM4 -> from base32 to hex -> CB4CD0656AE5CB696D2EA8492011305C4515

112233445566778899 -> from hex to base32 -> CETDGTCXN352TGI
CETDGTCXN352TGI -> from base32 to hex -> 112233445566778899

Expected behaviour

DBCCF06D8A5FB25C53A985C24A2C044C99314D9C -> from hex to base32 -> 3PGPA3MKL6ZFYU5JQXBEULAEJSMTCTM4
3PGPA3MKL6ZFYU5JQXBEULAEJSMTCTM4 -> from base32 to hex -> DBCCF06D8A5FB25C53A985C24A2C044C99314D9C

112233445566778899 -> from hex to base32 -> CERDGRCVMZ3YRGI=
CERDGRCVMZ3YRGI= -> from base32 to hex -> 112233445566778899

Version: 1.0.1.5

Obviously a base32 can never contain an '8' as it's prohibited.

jeanpaulrichter commented 6 years ago

@0x6d686b sorry for answering (as alwalys) terribly late. at the moment nppcrypt uses the DUDE alphabet ( https://tools.ietf.org/html/draft-ietf-idn-dude-02 ) for base32 encoding (ABCDEFGHIJKMNPQRSTUVWXYZ23456789) without a pad character. i believe cryptopp also supports RFC 4648 (https://tools.ietf.org/html/rfc4648) base32 encoding. maybe i will change it in the next version.