Skip to content

Overwrite Free Pockets R←127⌶Y

Overwrites all free pockets in the workspace.

Some applications (cryptography for example) make use of secure data during execution. The nature of the APL workspace is such that remnants of this secure data may persist in the workspace (and thus the process memory) even after the relevant APL variables have been expunged. This function overwrites all unused data pockets in the workspace so that any potentially secure data is removed.

Y is any empty array, preferably (zilde). R is always 1.

It is the responsibility of the programmer to ensure that there are no USED pockets in the workspace that reference the data.

Example

      foo;a
[1]    a'my secure data'
[2]    ⎕EX'a'
[3]    ⍝ 'my secure data' is now in an
[4]    ⍝ UNUSED pocket in the workspace
[5]    a1270 ⍝ all unused pockets are overwritten,
[6]            ⍝ 'my secure data' is no longer present
     

Whereas

      foo;a;b
[1]    a'my secure data'
[2]    ba
[3]    ⎕EX'a'
[4]    ⍝ 'my secure data' is now in an
[5]    ⍝ UNUSED pocket in the workspace
[6]    a1270 ⍝ all unused pockets are overwritten,
[7]            ⍝ but 'my secure data' is still present
[8]            ⍝ because it is referenced by b