comp.lang.ada
 help / color / mirror / Atom feed
* Crypting files with Ada
@ 2002-09-12 16:09 Preben Randhol
  2002-09-12 16:47 ` Preben Randhol
  0 siblings, 1 reply; 11+ messages in thread
From: Preben Randhol @ 2002-09-12 16:09 UTC (permalink / raw)


I would like to make a small utility in Ada that can encrypt/decrypt
files. I remember that some time back some links where posted here, but
I cannot find this thread now with Google. Which cryptographic
algorithm is best suited for this?

Thansk in advance.

Preben Randhol



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-12 16:09 Crypting files with Ada Preben Randhol
@ 2002-09-12 16:47 ` Preben Randhol
  2002-09-12 22:03   ` Adrian Knoth
  0 siblings, 1 reply; 11+ messages in thread
From: Preben Randhol @ 2002-09-12 16:47 UTC (permalink / raw)


On Thu, 12 Sep 2002 16:09:52 +0000 (UTC), Preben Randhol wrote:
> I would like to make a small utility in Ada that can encrypt/decrypt
> files. I remember that some time back some links where posted here, but
> I cannot find this thread now with Google. Which cryptographic
> algorithm is best suited for this?

10 minutes after posting I found Serpent which I think I'll use. Now I
only have to figure out how to erase decoded files...

Preben



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-12 16:47 ` Preben Randhol
@ 2002-09-12 22:03   ` Adrian Knoth
  2002-09-13  8:34     ` Preben Randhol
  0 siblings, 1 reply; 11+ messages in thread
From: Adrian Knoth @ 2002-09-12 22:03 UTC (permalink / raw)


Preben Randhol <randhol+news@pvv.org> wrote:

> Now I only have to figure out how to erase decoded files...

unlink()ing via FS does not work/is not what you're looking for?

So take your glibAda and call unlink(filename); Or even better remove();


-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Auch bei Wahrheiten mu� man auf das Verfallsdatum achten.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-12 22:03   ` Adrian Knoth
@ 2002-09-13  8:34     ` Preben Randhol
  2002-09-13 20:42       ` Adrian Knoth
  2002-09-17 14:49       ` Jacob Sparre Andersen
  0 siblings, 2 replies; 11+ messages in thread
From: Preben Randhol @ 2002-09-13  8:34 UTC (permalink / raw)


On 12 Sep 2002 22:03:16 GMT, Adrian Knoth wrote:
> Preben Randhol <randhol+news@pvv.org> wrote:
> 
>> Now I only have to figure out how to erase decoded files...
> 
> unlink()ing via FS does not work/is not what you're looking for?
> 
> So take your glibAda and call unlink(filename); Or even better
               ^^^^^^^
               what is this?
> remove();

I don't know. That is sth I have to find out. The problem is that if you
simply delete a file in say Windows or Linux you don't rease it you only
delete the link. So unless the OS has overwritten the place the file
occupied with new files one can recover it.

I guess one could change every byte in the file with 0 and then write
the file again before deleting it.

But thanks for the pointers I'll check it out.

Preben



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-13  8:34     ` Preben Randhol
@ 2002-09-13 20:42       ` Adrian Knoth
  2002-09-17 14:49       ` Jacob Sparre Andersen
  1 sibling, 0 replies; 11+ messages in thread
From: Adrian Knoth @ 2002-09-13 20:42 UTC (permalink / raw)


Preben Randhol <randhol+news@pvv.org> wrote:

>> So take your glibAda and call unlink(filename); Or even better
>               ^^^^^^^
>               what is this?

This is inexistend. Unfortunately. It is ment like 'glibc', but only
for Ada.

The library should implement remove() on top of the Kernel-API in Ada.

Another approach (which I don't like) would be a more or less direct
binding to glibc, so to say "Pragma Import" all the time.

> The problem is that if you simply delete a file in say Windows or Linux 
> you don't rease it you only delete the link. 

Right.

> So unless the OS has overwritten the place the file occupied with new 
> files one can recover it.

Yes. This is why someone intended wipe:

Description
       The  wipe  command  reads each file in sequence and writes
       over the file with nul characters.  If the  -i  option  is
       given,  it prompts the user before wiping the file.  If -d
       is given, it removes each  file  after  writing  over  it.
       (The default behavior is just to write over it.)  If -v is
       given, wipe will print the version number.

You may have a look at the source or re-implement it on your own. It
doesn't sound too difficult.
 
> I guess one could change every byte in the file with 0 and then write
> the file again before deleting it.

Better read from /dev/random :) And do multiple passes in order to
destroy remaining magnetization.


-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Das Gras steht hoch, man kann kaum mehr blicken,
das ist die richtige Zeit zum --- Rasenmaehen.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-13  8:34     ` Preben Randhol
  2002-09-13 20:42       ` Adrian Knoth
@ 2002-09-17 14:49       ` Jacob Sparre Andersen
  2002-09-17 14:55         ` Preben Randhol
  2002-09-17 18:26         ` Ted Dennison
  1 sibling, 2 replies; 11+ messages in thread
From: Jacob Sparre Andersen @ 2002-09-17 14:49 UTC (permalink / raw)


Preben Randhol wrote:

> I don't know. That is sth I have to find out. The problem is that if you
> simply delete a file in say Windows or Linux you don't rease it you only
> delete the link. So unless the OS has overwritten the place the file
> occupied with new files one can recover it.

Yes.

> I guess one could change every byte in the file with 0 and then write
> the file again before deleting it.

This would not necessarily be enough. According to a paper 
by Peter Gutmann, you ought to overwrite the file 35 times 
with different bit patterns. You can find an implementation 
of this here:

    http://www.linux-kurser.dk/secure_harddisk_eraser.html

(it's written in C)

Jacob
-- 
"This page inadvertently left blank."




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-17 14:49       ` Jacob Sparre Andersen
@ 2002-09-17 14:55         ` Preben Randhol
  2002-09-17 17:44           ` Jacob Sparre Andersen
  2002-09-17 18:26         ` Ted Dennison
  1 sibling, 1 reply; 11+ messages in thread
From: Preben Randhol @ 2002-09-17 14:55 UTC (permalink / raw)


On Tue, 17 Sep 2002 16:49:42 +0200, Jacob Sparre Andersen wrote:
> 
> This would not necessarily be enough. According to a paper 
> by Peter Gutmann, you ought to overwrite the file 35 times 
> with different bit patterns. You can find an implementation 
> of this here:
> 
>     http://www.linux-kurser.dk/secure_harddisk_eraser.html

This one overwrite the entire harddisk.
 
> (it's written in C)

I'll make a port if I can find the source :-)

Preben



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-17 14:55         ` Preben Randhol
@ 2002-09-17 17:44           ` Jacob Sparre Andersen
  0 siblings, 0 replies; 11+ messages in thread
From: Jacob Sparre Andersen @ 2002-09-17 17:44 UTC (permalink / raw)


Preben Randhol wrote:
> On Tue, 17 Sep 2002 16:49:42 +0200, Jacob Sparre Andersen wrote:

>>    http://www.linux-kurser.dk/secure_harddisk_eraser.html
> 
> This one overwrite the entire harddisk.

Yes. But the rest of the algorithm should be useful for your 
purpose.

> I'll make a port if I can find the source :-)

I have told Ole that it is quite hard to find. He will 
hopefully fix that problem soon.

Jacob
-- 
"simply because no one had discovered a cure for the 
universe as a
  whole - or rather the only one that did exist had been 
abolished"




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-17 14:49       ` Jacob Sparre Andersen
  2002-09-17 14:55         ` Preben Randhol
@ 2002-09-17 18:26         ` Ted Dennison
  2002-09-17 19:13           ` Jacob Sparre Andersen
  1 sibling, 1 reply; 11+ messages in thread
From: Ted Dennison @ 2002-09-17 18:26 UTC (permalink / raw)


Jacob Sparre Andersen <sparre@nbi.dk> wrote in message news:<3D874106.8020809@nbi.dk>...
> This would not necessarily be enough. According to a paper 
> by Peter Gutmann, you ought to overwrite the file 35 times 

Hmm...if you were to install Windows over it, then give the disk away,
that might do the trick. The user will certianly have to reinstall
Winodws 35 times in the next year or so. :-)

(ducks and runs)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
  2002-09-17 18:26         ` Ted Dennison
@ 2002-09-17 19:13           ` Jacob Sparre Andersen
  0 siblings, 0 replies; 11+ messages in thread
From: Jacob Sparre Andersen @ 2002-09-17 19:13 UTC (permalink / raw)


Ted Dennison wrote:

> Hmm...if you were to install Windows over it, then give the disk away,
> that might do the trick. The user will certianly have to reinstall
> Winodws 35 times in the next year or so. :-)

That might be true, but you can not be certain that it is 
the correct sequence of patterns (includes six times random 
patterns IIRC) you get out of that. You would have to do it 
much more often, if it was a different collection of patterns.

Jacob
-- 
ACRONYM: A Contrived Reduction Of Nomenclature Yielding 
Mnemonics




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Crypting files with Ada
@ 2002-09-18  7:29 Grein, Christoph
  0 siblings, 0 replies; 11+ messages in thread
From: Grein, Christoph @ 2002-09-18  7:29 UTC (permalink / raw)


dennison@telepath.com (Ted Dennison)
> 
> (ducks and runs)

Ducks can't run very fast, should be flies, but flies hum :-)



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-09-18  7:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-12 16:09 Crypting files with Ada Preben Randhol
2002-09-12 16:47 ` Preben Randhol
2002-09-12 22:03   ` Adrian Knoth
2002-09-13  8:34     ` Preben Randhol
2002-09-13 20:42       ` Adrian Knoth
2002-09-17 14:49       ` Jacob Sparre Andersen
2002-09-17 14:55         ` Preben Randhol
2002-09-17 17:44           ` Jacob Sparre Andersen
2002-09-17 18:26         ` Ted Dennison
2002-09-17 19:13           ` Jacob Sparre Andersen
  -- strict thread matches above, loose matches on Subject: below --
2002-09-18  7:29 Grein, Christoph

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