comp.lang.ada
 help / color / mirror / Atom feed
From: Austin Obyrne <austin.obyrne@hotmail.com>
Subject: Re: Technical Question.
Date: Mon, 9 Jun 2014 10:54:17 -0700 (PDT)
Date: 2014-06-09T10:54:17-07:00	[thread overview]
Message-ID: <d85941f2-5395-4b18-adef-6e50e07fa9b9@googlegroups.com> (raw)
In-Reply-To: <ed3d0c2f-72ab-4e59-af7c-c466f8b38815@googlegroups.com>

On Monday, June 9, 2014 1:50:09 PM UTC+1, Austin Obyrne wrote:
> On Monday, June 9, 2014 1:15:46 PM UTC+1, Austin Obyrne wrote: > A cryptographic cipher I have written is demonstrable by mathematical proof to be the ultimate in cryptographic strength i.e. it is of "Theoretically Unbreakable Class" in official crypto terminology. Although the algorithm is written in stone by analogy I always avail of any extra entanglement (usually considerable) that may up for grabs at the programming stage when I write any cipher programs. This is often a property of the Ada language alone quite part from the general cipher mathematical algorithm. Demonstration. This is an array below that loads the 'I' coefficients of a vector (the J and K coefficients are elsewhere also in other arrays not shown here). *The elements of the array reside in off-page (In the folder) reservoirs called 'packages' (Case Statements) when not required and are loaded into the ready-use array called 'E' initially at boot-up time of the computer. The procedure below scrambles the elements of the array called 'E' by positional reshuffling them from their original assigned position and repositioning them by controlled means in another array called 'EE'. That procedure is safely invertible at decryption time and so far this ploy has never let me down. The elements of 'E' are scrambled while being loaded into the array 'EE' and are later called *sequentially from 'EE' for use by the main program at run-time as key material. Question. Is this ploy of scrambling key material by this means legit in Ada - i.e. is it sanctioned by the Ada reference manual ? i.e. is it acceptable to you guys as *proper Ada orogramming practice?. I intend to go on using it but I would like to know what you think. This ploy is my own invention. I would be grateful for your replies. -------------------------------------------------------------------------------- PROCEDURE Load_n_Scramble_Normal_Vector_I_Coefficients IS -- Pre: Normal_Vector_I_Coefficients_ Package is defined. -- Post: These coefficients are stored in ready use arrays at runtime. BEGIN -- Load_Normal_Vector_I_Coefficients FOR I IN 1 .. 1000 LOOP E(I) := Normal_Vector_I_Coefficients.NumberExchange(Numin => I); EE(I) := Normal_Vector_I_Coefficients.NumberExchange(Numin => I); -- Q := E(I); -- statistical data collection -- I_Num(Q):= I_Num(Q)+1; -- these numbers tested ok for randomness END LOOP; X := 0; FOR J IN 1 .. iterances LOOP FOR I IN REVERSE X+1 .. X+increment LOOP X:=X+1; EE(X) := E(I); -- Ada.Text_IO.New_Line;-- -- Ada.Integer_Text_IO.Put(Item => E(X), Width => 8);-- -- Ada.Integer_Text_IO.Put(Item => EE(X), Width => 8);-- END LOOP; -- Ada.Text_IO.New_Line;-- END LOOP; -- Ada.Integer_Text_IO.Get(Item => View); -- halts program to allow view.-- END Load_n_Scramble_Normal_Vector_I_Coefficients; ------------------------------------ ------------------------------------------ Thanks in anticipation of your help, Austin O'Byrne - adacrypr Forgot to include these scrambling parameters, Increment : CONSTANT Integer := 20; Iterances : CONSTANT Integer := 50; -- Normals scrambling -- Increment * Iterances <= 1000. -- specifies the scope of the scrambling data. Austin

 Late annotation.

 X := 0; 
  FOR J IN 1 .. iterances LOOP 
  FOR I IN REVERSE X+1 .. X+increment LOOP 
    X:=X+1; 
    EE(X) := E(I); 
--  Ada.Text_IO.New_Line;-- 
--  Ada.Integer_Text_IO.Put(Item => E(X), Width => 8);-- 
--  Ada.Integer_Text_IO.Put(Item => EE(X), Width => 8);-- 
  END LOOP; 
--  Ada.Text_IO.New_Line;-- 
  END LOOP; 
--  Ada.Integer_Text_IO.Get(Item => View);  -- halts program to allow view.-- 
END Load_n_Scramble_Normal_Vector_I_Coefficients; 

For this setting of scrambling parameters i.e increment := 20,iterances := 50

The inner loop puts element - 
No 20 of 'E' into position 1 of 'EE'
No 19 of 'e' goes to position 2 of 'EE' and so on to completion of the inside LOOP and all elements from 20 to 1 have been transposed.

The outside loop repeats that 50 times so as to position all of the elements of 'E' in displaced positions in 'EE'.

What's bothering me is this.  Ada has some very distinct rules about what can be done with operating on arrays and strings.  Although my method works does it do so within all of these rules and not be just a lucky bug ????

adacrypt

  reply	other threads:[~2014-06-09 17:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 12:15 Technical Question Austin Obyrne
2014-06-09 12:50 ` Austin Obyrne
2014-06-09 17:54   ` Austin Obyrne [this message]
2014-06-15 21:31 ` Niklas Holsti
2014-06-16 12:49   ` Austin Obyrne
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox