Re: base26 Encoder/Decoder

Liste des GroupesRevenir à s crypt 
Sujet : Re: base26 Encoder/Decoder
De : pollux (at) *nospam* tilde.club (Stefan Claas)
Groupes : sci.crypt
Date : 25. Apr 2024, 17:01:36
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <v0dup1$276id$2@i2pn2.org>
References : 1 2 3
Stefan Claas wrote:

Cri-Cri wrote:
 
On Fri, 19 Jan 2024 21:05:20 +0100, Stefan Claas wrote:
 
if you like the Diana Cryptosystem and want to use it with a foreign
language, on an offline Computer, you may find my base26 Encoder/Decoder
useful.
 
Found a Python version:
https://pypi.org/project/base26/#files
 
Example:
 
import base26
base26.encode(b'test')
'EWJILIG'
base26.decode('EWJILIG')
b'test'
 
 
I now have a Rust Version, derived from the Python library and
it encodes 'test' with the same result, but when encoding with
Rust, the Python code can not decode properly, while decoding
from Python with Rust works. Oh, well ... :-(
(Wish I was a Programmer!)

Ok, I figured out that my Python3 code example is bad. So the
Rust Version works the same as the library. :-)

$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
import base26
base26.encode(b'The quick brown fox jumps over the lazy dog.')
'AAZCESYRPSBENRDWLUQLYETYZZJCPAHHAVEIPLIONRSBHYUEHANMAUZZQCSOGOXJEBILDQVWRGD'
>
$ echo -n 'AAZCESYRPSBENRDWLUQLYETYZZJCPAHHAVEIPLIONRSBHYUEHANMAUZZQCSOGOXJEBILDQVWRGD' | b26 -d
The quick brown fox jumps over the lazy dog.
$ echo -n 'Hello sci.crypt' | b26
UQZGYLNMDHTUDTGJYKJRQGDKOC

$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
import base26
base26.decode('UQZGYLNMDHTUDTGJYKJRQGDKOC')
b'Hello sci.crypt'
>

Ok. everything is fine. :-)

--
Regards
Stefan






Date Sujet#  Auteur
25 Apr 24 * Re: base26 Encoder/Decoder22Stefan Claas
25 Apr 24 `* Re: base26 Encoder/Decoder21Stefan Claas
25 Apr 24  +* Re: base26 Encoder/Decoder3Stefan Claas
26 Apr 24  i`* Re: base26 Encoder/Decoder2Stefan Claas
26 Apr 24  i `- Re: base26 Encoder/Decoder1Stefan Claas
27 Apr 24  `* Re: base26 Encoder/Decoder17Stefan Claas
28 Apr 24   `* Re: base26 Encoder/Decoder16Stefan Claas
28 Apr 24    +- Re: base26 Encoder/Decoder1Stefan Claas
28 Apr 24    `* Re: base26 Encoder/Decoder14Herbert Kleebauer
28 Apr 24     `* Re: base26 Encoder/Decoder13Stefan Claas
28 Apr 24      +- Re: base26 Encoder/Decoder1Stefan Claas
28 Apr 24      `* Re: base26 Encoder/Decoder11Herbert Kleebauer
28 Apr 24       +- Re: base26 Encoder/Decoder1Stefan Claas
28 Apr 24       `* Re: base26 Encoder/Decoder9Stefan Claas
29 Apr 24        `* Re: base26 Encoder/Decoder8Stefan Claas
30 Apr 24         `* Re: az - Telefax/OCR Test (was: base26 Encoder/Decoder)7Stefan Claas
30 Apr 24          `* Re: az - Telefax/OCR Test6Herbert Kleebauer
1 May 24           `* Re: az - Telefax/OCR Test5Stefan Claas
1 May 24            `* Re: az - Telefax/OCR Test4Herbert Kleebauer
2 May 24             `* Re: az - Telefax/OCR Test3Stefan Claas
4 May 24              `* Re: az - Telefax/OCR Test2Stefan Claas
4 May 24               `- Re: az - Telefax/OCR Test1Stefan Claas

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal