Le 26 mars 2008 à 21:44, Trans a écrit :
> On Mar 26, 4:27 pm, MenTaLguY <men...@rydia.net> wrote:
>> On Thu, 27 Mar 2008 05:13:23 +0900, Trans <transf...@gmail.com> wrote:
>>> I need to take an arbitrary byte string and encode it as alphanumeric
>>> (and decode it back again). Any pointers on a easy way to do this?
>>
>> What sort of encoding do you have in mind? Hexadecimal? Base64?
>
> I'm using a two-way encryption algorithm to create a registration key.
> The encryption algorithm produces an arbitrary byte string. I need to
> encode that into something I can give to a end-user, ie. an
> alphanumeric string.
How long is your key ? If it's relatively short, you could use the
mechanism described in the RFC 1760 (S/KEY), which shows a method to
converts a number into a group of 6 small words.
| 0: 3D8B BA84 B4A5 E7E2
| 1: 5F2A 00BE DCF1 E6AD
Becomes :
| 0: SOP BOUT JESS COED BRAG TURF
| 1: BRIM AWAY OR MELT IRE BESS
(It's used in the OPIE implementations on some *nix systems ; on
FreeBSD, I made the above with azertyuiop as a passphrase and
| 22:46 fred@balvenie:~> opiekey -x -n 5 1 zb78774
| 22:46 fred@balvenie:~> opiekey -n 5 1 zb78774
Fred
--
Error: No applicable methods for #<STANDARD-GENERIC-FUNCTION CLOS:SLOT-
VALUE-USING-CLASS 506F939A> with args (#<BUILT-IN-CLASS NULL 5072054C>
NIL ADDRESS) Sorry, what is this "wife" thing? Is it related to the
rumoured existence of something called "life" ? (Arvid Grøtting, SDM)