Talk:The ISAAC cipher: Difference between revisions

(→‎caesar vs. xor: new section)
 
(10 intermediate revisions by 3 users not shown)
Line 14:
 
:::As suggested, I have coded a fully working solution in C and brought Pascal into line with this. The two programs' XOR encryption outputs are identical. --[[User:BlaiseP|BlaiseP]] ([[User talk:BlaiseP|talk]]) 10:14, 23 July 2014 (UTC)
 
== Pascal Compiler error(s) ==
 
Curious as I am sometimes, I installed free Pascal and got this compiler error(s)
https://www.dropbox.com/l/a6rIEG5zByiM4UDKhwGMpr?
(The IDE does not allow copy / paste :-(
Any advice?? --[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 10:35, 23 July 2014 (UTC)
:Odd, but you have a default Lazarus install, I think(?). I'm compiling mine on the command line with
 
::fpc isaac.pas
 
:and I am using Standard FPC, ie. no extra $defines. It's possible you're in Delphi mode, as you seem to be getting errors in the area of function return parameters. Delphi uses <result := VAR>, standard Pascal uses the name of the function, like <Vernam := VAR>. Please use the most recently amended copy (edited today) and also try the C version. You may have to delve into your fpc.cfg file and check what compile options you have set. --[[User:BlaiseP|BlaiseP]] ([[User talk:BlaiseP|talk]]) 10:58, 23 July 2014 (UTC)
 
::stop press. it works (after restart when the path became active)
<pre>Message: a Top Secret secret
Key : this is my secret key
XOR : 1C0636190B1260233B35125F1E1D0E2F4C5422
MOD : 734270227D36772A783B4F2A5F206266236978</pre>
--[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 19:50, 23 July 2014 (UTC)
:::Ah good. I was going to suggest adding the fpc bin directory to your %PATH but your install seems to have done that by default. I noticed you were using the old DOS-style (Turbo Pascal) IDE to compile. While there is nothing whatever wrong with this, I'd recommend using a good programmer's text editor like [http://notepad-plus-plus.org/ Notepad++] (Windows) or [http://www.geany.org/ Geany] (Linux) for viewing and editing your code, and then just compiling on the command line with >fpc filename.pas. Simple is often best :) --[[User:BlaiseP|BlaiseP]] ([[User talk:BlaiseP|talk]]) 06:55, 24 July 2014 (UTC)
::::I'm happily using Kedit ever since I "lost" VM's Xedit and TSO's ISPF Editor. Can I ask you one or the other Pascal Question offline if some arise)? pachl .. chello.at --[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 08:51, 24 July 2014 (UTC)
:::::Sure - I'll gladly help in any way I can. --[[User:BlaiseP|BlaiseP]] ([[User talk:BlaiseP|talk]]) 09:30, 24 July 2014 (UTC)
 
== caesar vs. xor ==
 
In the C implementation, we have:
 
<lang C> // Encrypt: Vernam XOR
iSeed(key,1);
strcpy(vctx, Vernam(msg));
// Encrypt: Caesar
strcpy(cctx, CaesarStr(mEncipher, msg, MOD, START));</lang>
 
In other words: the "seed" used for the caesar encryption is not they task specified key, but the task specified key as modified by use of vernam encryption.
 
This should probably be fixed. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 22:07, 8 August 2022 (UTC)
6,951

edits