"Sputnik" help  
Sputnik Help
EncryptThreefish

Description

 

Parameters

   

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

 

Related

Example

Example of usage with a randomly generated key:

my $pass = EncCreatePass();
my $enc = EncryptThreefish($pass, "The quick brown fox!");
say BinaryExpand($enc);
say DecryptThreefish($pass, $enc);

// PRINTS
// 00 | C1 5C 59 30 2B CA 54 01 60 F3 FC C9 FA B7 07 3E Á\Y0+ÊT.`óüÉú·.>
// 01 | 63 61 2B F2 E8 56 03 36 F9 80 2E D6 C6 1C 00 DC ca+òèV.6ù..ÖÆ..Ü
// 02 | 55 3C BA DE 24 B8 67 71 15 DA 12 84 FF C4 90 F6 U<ºÞ$¸gq.Ú..ÿÄ.ö
// 03 | 4D 0C 4B DC D0 C6 72 4E E2 99 CA 3B 62 59 44 A8 M.KÜÐÆrNâ.Ê;bYD¨
// 04 | EA 00 2A 3A 64 8E 04 42 C7 88 E0 B9 22 C2 CD A1 ê.*:d..BÇ.à."ÂÍ¡
// 05 | 20 01 9C D1 8B 58 C0 69 87 7B 3B 00 DF 3F E8 0D  ..Ñ.XÀi.{;.ß?è.
// 06 | FF 8B D1 F1 F1 37 7A 63 B0 57 EB 5D F1 7A 79 5E ÿ.Ñññ7zc°Wë]ñzy^
// 07 | 02 43 51 A4 1D D9 15 28 E7 57 B8 8E 4D 6C 7C 53 .CQ¤.Ù.(çW¸.Ml|S
// The quick brown fox!

Example of using the tweak:

my $salt = B"\x32\x5B\xBC\x8E\x0D\xBB\xB5\x50\x92\xF0\xC9\x0B\x83\xC0\x8B\xE8";
my $tweak = pack("KK", 777, 42);
my $pass = EncCreatePass("<<OmegaCatDogAlpha7>>", 1024, $salt);
my $enc = EncryptThreefish($pass, "The quick brown fox!", $tweak);
say BinaryExpand($enc);
say DecryptThreefish($pass, $enc, $tweak);

// PRINTS
// 00 | FA D3 F9 3C 38 82 E5 B9 A5 15 0A 45 BD 1E 24 D6 úÓù<8.å.¥..E..$Ö
// 01 | 0D 91 B3 27 8B A2 A4 41 66 04 A4 08 BE 6C 6F D8 ...'.¢¤Af.¤..loØ
// 02 | 85 B2 33 FC 7D 88 41 59 FC B1 33 12 3A 9C DC 17 ..3ü}.AYü±3.:.Ü.
// 03 | 21 93 B2 D4 32 D1 AE 5F A7 65 57 01 0E 01 A4 BC !..Ô2Ñ®_§eW...¤.
// 04 | 07 73 05 A2 1F 73 3F 7B B0 C4 9F F1 06 71 4E 25 .s.¢.s?{°Ä.ñ.qN%
// 05 | 76 25 F3 F5 A1 1D 5B 3B 51 22 D3 44 42 9E 34 50 v%óõ¡.[;Q"ÓDB.4P
// 06 | E4 31 20 2C 48 D6 F7 0B 5F 20 A3 FB 34 F1 50 91 ä1 ,HÖ÷._ £û4ñP.
// 07 | A8 A6 80 41 8C 99 91 D9 10 D7 D5 69 C9 D5 AA A3 ¨¦.A...Ù.×ÕiÉÕª£
// The quick brown fox!

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org