Re: encrypting files

2006-07-21 Thread Jonathan Thornburg
 I have been thinking about encrypting some private files on my laptop,
 in case it gets stolen.

I have a general comment, and a specific software suggestion:

General comment:

Whatever encryption solution you use, think seriously about backups!
That is, if your data is important enough to encrypt, it's surely
important enough to need backups.  If you backup the plaintext, do
you trust the security of whereever those backups get stored?  Maybe
you want to backup the ciphertext instead...



Now for the specific software suggestion:

I have been using cvs (available in ports) for 10+ years now,
and am happy with it.  It's an encrypting file system.

Advantages:
* transparent encryption, with keys on a per-directory-tree granularity
* can run on many different Unix flavors without needing custom kernels

Disadvantages:
* performance is a lot lower than an in-kernel crypto filesystem
  (but for modern hardware and moderate-sized files, the cryto
  overheads are still only tiny fractions of a second)
* security is probably good enough to stop casual snooping, but
  likely wouldn't stop serious spooks like the NSA et al (see
http://www.usenix.org/publications/login/2004-08/pdfs/howard.pdf
  for some recent cryptanalysis work)
* it's pretty close to unmaintained now -- the cfs-users mailing
  list seems to have been dead for several years :(

ciao,

-- 
-- Jonathan Thornburg [EMAIL PROTECTED]  
   Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
   Golm, Germany, Old Europe http://www.aei.mpg.de/~jthorn/home.html  
   Washing one's hands of the conflict between the powerful and the
powerless means to side with the powerful, not to be neutral.
  -- quote by Freire / poster by Oxfam



Re: Encrypting files

2006-07-02 Thread Joachim Schipper
On Sun, Jul 02, 2006 at 02:14:59AM +0200, Rico Secada wrote:
 Hi
 
 I have been thinking about encrypting some private files on my laptop,
 in case it gets stolen.
 
 I have no prior experience in this field.
 
 I have been thinking about using mcrypt with blowfish, but is this a
 good way to go about? Are there a better alternative? And is blowfish
 the best way to encrypt it?
 
 Please bear with me if these questions are ignorent.

There are many solutions; not mentioned yet is gnupg, which has quite a
few bells and whistles you don't need but is otherwise a rather solid
program (or so I used to think; there have been a few vulnerabilities in
the past month or two).

However, svnd is probably the most convenient if you are running
-current.

Do remember to remove the original files; rm -P, as suggested, works.

Joachim



Re: Encrypting files

2006-07-02 Thread Sigfred HÃ¥versen

Joachim Schipper wrote:

On Sun, Jul 02, 2006 at 02:14:59AM +0200, Rico Secada wrote:


Hi

I have been thinking about encrypting some private files on my laptop,
in case it gets stolen.

I have no prior experience in this field.

I have been thinking about using mcrypt with blowfish, but is this a
good way to go about? Are there a better alternative? And is blowfish
the best way to encrypt it?

Please bear with me if these questions are ignorent.



There are many solutions; not mentioned yet is gnupg, which has quite a
few bells and whistles you don't need but is otherwise a rather solid
program (or so I used to think; there have been a few vulnerabilities in
the past month or two).

However, svnd is probably the most convenient if you are running
-current.

Do remember to remove the original files; rm -P, as suggested, works.


A users tmp files should be encrypted as well. Setting TMPDIR to point into
an encrypted filesystem may be enough, assuming that the application(s) respect
TMPDIR.

/Sigfred



Re: Encrypting files

2006-07-02 Thread Joachim Schipper
On Sun, Jul 02, 2006 at 12:00:34PM +0200, Sigfred H?versen wrote:
 Joachim Schipper wrote:
 On Sun, Jul 02, 2006 at 02:14:59AM +0200, Rico Secada wrote:
 
 Hi
 
 I have been thinking about encrypting some private files on my laptop,
 in case it gets stolen.
 
 I have no prior experience in this field.
 
 I have been thinking about using mcrypt with blowfish, but is this a
 good way to go about? Are there a better alternative? And is blowfish
 the best way to encrypt it?
 
 Please bear with me if these questions are ignorent.
 
 
 There are many solutions; not mentioned yet is gnupg, which has quite a
 few bells and whistles you don't need but is otherwise a rather solid
 program (or so I used to think; there have been a few vulnerabilities in
 the past month or two).
 
 However, svnd is probably the most convenient if you are running
 -current.
 
 Do remember to remove the original files; rm -P, as suggested, works.
 
 A users tmp files should be encrypted as well. Setting TMPDIR to point into
 an encrypted filesystem may be enough, assuming that the application(s) 
 respect TMPDIR.

Yes, indeed, I should have pointed that out. Thoroughly wiping the
filesystem /tmp resides on (at boot?) works, too.

However, many important files may be kept elsewhere; for instance, vim
uses .filename.swp for swap files, and while this certainly has
advantages, it does not make for optimal security...

All in all, svnd is probably the most convenient option; any other
option requires a lot of work.

Note that, on other systems, a huge problem is that files may be written
to swap at any time unless the memory was specifically allocated not to
allow this (certain high-security programs, like gnupg, do this for at
least part of the memory; but editors typically don't). This means that
the swap partition(s) also need periodic overwriting. However, OpenBSD
uses encrypted swap by default, at least on more-or-less recent
versions.

Joachim



Re: Encrypting files

2006-07-02 Thread Chris Kuethe

Bear in mind that if you're serious about keeping plaintext away from
people who you don't want to see it, this could get quite tricky.

What happens if an application generates temporary files? What happens
if an application swaps? What happens if an application crashes and
dumps core? What happens if the kernel crashes and dumps core? What
happens if you accidentally copy and past some content into your
shell, thereby logging it into your .history?

Certain editors (vim for sure, probably emacs too) can encrypt your
files on the fly. I don't use that feature, but if you do, make sure
they handle temp files properly, etc.

Be very careful - just because your long-term, bulk storage is
encrypted there is no guarantee that you haven't left plaintext
anywhere.

And that's not even taking into account that the thief might just put
trojan horses all over your laptop before letting you have it back.
Think of how often you hear of windows machines being turned into
spambots with keyloggers. Just because it seems to be mostly windows
machines doesn't mean it can't happen. *NIX makes it easy for even a
moderately competent programmer to write a trivial keylogger.

CK

--
GDB has a 'break' feature; why doesn't it have 'fix' too?



Re: Encrypting files

2006-07-02 Thread Joachim Schipper
On Sun, Jul 02, 2006 at 10:57:42AM -0600, Chris Kuethe wrote:
 Bear in mind that if you're serious about keeping plaintext away from
 people who you don't want to see it, this could get quite tricky.
 
 What happens if an application generates temporary files? What happens
 if an application swaps? What happens if an application crashes and
 dumps core? What happens if the kernel crashes and dumps core?

Well, in that case, you are usually sufficiently alerted to clean out
the relevant parts of the disk.

(Note that the case where you do not have administrator access is not
relevant, as root can read your files any time you can, anyway.)

 What
 happens if you accidentally copy and past some content into your
 shell, thereby logging it into your .history?

 Certain editors (vim for sure, probably emacs too) can encrypt your
 files on the fly. I don't use that feature, but if you do, make sure
 they handle temp files properly, etc.
 
 Be very careful - just because your long-term, bulk storage is
 encrypted there is no guarantee that you haven't left plaintext
 anywhere.

But this is still good advice; a crashing kernel is not very believable,
but such mundane mistakes are likely to provide at least snippets of
information.

More importantly, a file like ~/.viminfo contains quite a bit of
information. I *suppose* vim handles encrypted files in a sane fashion,
but I am not sure.

 And that's not even taking into account that the thief might just put
 trojan horses all over your laptop before letting you have it back.
 Think of how often you hear of windows machines being turned into
 spambots with keyloggers. Just because it seems to be mostly windows
 machines doesn't mean it can't happen. *NIX makes it easy for even a
 moderately competent programmer to write a trivial keylogger.

If you do *that*, however, you are just being stupid. Wipe and
reinstall; if the data is important, preserve that - but no binaries or
somesuch.

Joachim



Re: Encrypting files

2006-07-02 Thread Nick Guenther

On 7/2/06, Chris Kuethe [EMAIL PROTECTED] wrote:

Bear in mind that if you're serious about keeping plaintext away from
people who you don't want to see it, this could get quite tricky.


And that's not even taking into account that the thief might just put
trojan horses all over your laptop before letting you have it back.
Think of how often you hear of windows machines being turned into
spambots with keyloggers. Just because it seems to be mostly windows
machines doesn't mean it can't happen. *NIX makes it easy for even a
moderately competent programmer to write a trivial keylogger.


This is a good thread!

I have some questions though:
How can you make a keylogger on UNIX? I thought that UNIX segmented
it's memory spaces, unlike Windows which has the problem of a global
key trampoline (I'm sorry, I read this somewhere once and do not
remember exactly what it was called). I suppose if you replaced the
kernel than you could do this but I don't think that's what was meant.

How do you choose between svnd and vnd devices? I'm guessing the type
of the device is determined by whether you do `vnconfig svnd...` or
`vnconfig vnd` but the manpage doesn't explicitly say this.

-Nick



Re: Encrypting files

2006-07-02 Thread Peter Philipp
On Sun, Jul 02, 2006 at 02:56:03PM -0400, Nick Guenther wrote:
 I have some questions though:
 How can you make a keylogger on UNIX? I thought that UNIX segmented
 it's memory spaces, unlike Windows which has the problem of a global
 key trampoline (I'm sorry, I read this somewhere once and do not
 remember exactly what it was called). I suppose if you replaced the
 kernel than you could do this but I don't think that's what was meant.

I think this was meant.  man wskbd tells a little about the keyboard and
the routines for this are in /sys/dev/wscons I think.  Because you have
the source, can recompile and the code is written with KISS in mind you'll
be able to patch something up.  However if you do you should check your
morals, they come back to haunt you if you abuse them.  Running a default
kernel compiled by deraadt directly from the CD-ROM should ensure that no
keylogger of any sort is installed in the kernel.  There really isn't much 
reason to compile your own kernel unless you add your own stuff or want to 
change something.

-peter

-- 
Here my ticker tape .signature  My name is Peter Philipp  lynx -dump 
http://en.wikipedia.org/w/index.php?title=Pufferfisholdid=20768394; | sed -n 
131,136p  So long and thanks for all the fish!!!



Re: Encrypting files

2006-07-02 Thread Nick Guenther

On 7/2/06, Peter Philipp [EMAIL PROTECTED] wrote:

On Sun, Jul 02, 2006 at 02:56:03PM -0400, Nick Guenther wrote:
 I have some questions though:
 How can you make a keylogger on UNIX? I thought that UNIX segmented
 it's memory spaces, unlike Windows which has the problem of a global
 key trampoline (I'm sorry, I read this somewhere once and do not
 remember exactly what it was called). I suppose if you replaced the
 kernel than you could do this but I don't think that's what was meant.

I think this was meant.  man wskbd tells a little about the keyboard and
the routines for this are in /sys/dev/wscons I think.  Because you have
the source, can recompile and the code is written with KISS in mind you'll
be able to patch something up.  However if you do you should check your
morals, they come back to haunt you if you abuse them.  Running a default
kernel compiled by deraadt directly from the CD-ROM should ensure that no
keylogger of any sort is installed in the kernel.  There really isn't much
reason to compile your own kernel unless you add your own stuff or want to
change something.


Ah, okay, thank you! I see a lot go across on this list only
half-explained, which is good for those who know what is going on but
not for newbies like me.

It's nice that this list is the sort of place where you are expected
to use your own morals instead of blindly following the no hacking is
bad! mantra. For the record, I was just curious, I'm not actually
planning on bugging my systems.

-Nick



Re: Encrypting files

2006-07-02 Thread Joachim Schipper
On Sun, Jul 02, 2006 at 02:56:03PM -0400, Nick Guenther wrote:
 On 7/2/06, Chris Kuethe [EMAIL PROTECTED] wrote:
 Bear in mind that if you're serious about keeping plaintext away from
 people who you don't want to see it, this could get quite tricky.
 
 
 And that's not even taking into account that the thief might just put
 trojan horses all over your laptop before letting you have it back.
 Think of how often you hear of windows machines being turned into
 spambots with keyloggers. Just because it seems to be mostly windows
 machines doesn't mean it can't happen. *NIX makes it easy for even a
 moderately competent programmer to write a trivial keylogger.
 
 This is a good thread!
 
 I have some questions though:
 How can you make a keylogger on UNIX? I thought that UNIX segmented
 it's memory spaces, unlike Windows which has the problem of a global
 key trampoline (I'm sorry, I read this somewhere once and do not
 remember exactly what it was called). I suppose if you replaced the
 kernel than you could do this but I don't think that's what was meant.

UNIX offers some very nice things, including ptys, ttys, and pipes. ptys
were made for the explicit purpose of allowing programs to send and
receive stuff to a tty-like interface, but with a program on the other
end (instead of a terminal).

You are right that reading keystrokes out of kernel memory is not
trivial, and impossible without superuser priviliges, but if you already
are the user whose keystrokes you want to snoop, it's not very
difficult.

 How do you choose between svnd and vnd devices? I'm guessing the type
 of the device is determined by whether you do `vnconfig svnd...` or
 `vnconfig vnd` but the manpage doesn't explicitly say this.

That's correct, you will want to name a complete device, though - so
vnconfig svnd0 (...).

Joachim



Re: Encrypting files

2006-07-02 Thread Joachim Schipper
On Sun, Jul 02, 2006 at 09:34:50PM +0200, Peter Philipp wrote:
 On Sun, Jul 02, 2006 at 02:56:03PM -0400, Nick Guenther wrote:
  I have some questions though:
  How can you make a keylogger on UNIX? I thought that UNIX segmented
  it's memory spaces, unlike Windows which has the problem of a global
  key trampoline (I'm sorry, I read this somewhere once and do not
  remember exactly what it was called). I suppose if you replaced the
  kernel than you could do this but I don't think that's what was meant.
 
 I think this was meant.  man wskbd tells a little about the keyboard and
 the routines for this are in /sys/dev/wscons I think.  Because you have
 the source, can recompile and the code is written with KISS in mind you'll
 be able to patch something up.  However if you do you should check your
 morals, they come back to haunt you if you abuse them.  Running a default
 kernel compiled by deraadt directly from the CD-ROM should ensure that no
 keylogger of any sort is installed in the kernel.

Well, provided the BIOS (or equivalent) cannot be flashed from the
kernel, yes.

Of course, worrying about this requires raging paranoia. But from a
quick look, flashing the BIOS and combining it with an attack like the
recent Blue Pill
http://theinvisiblethings.blogspot.com/2006/06/introducing-blue-pill.html
(and elsewhere, but this one looks pretty complete) method would make
for a *very* nasty rootkit.

Just rewriting the kernel that is loaded by the bootloader would also be
nasty, and potentially undetectable from software, too - but that's old
news, and I have a vague notion that the above could likely be done in
fewer instructions, which means that it's easier to put in what limited
space is available.

Of course, if you have people who can do this and are willing to invest
the time to actually do it after you, be glad you're running OpenBSD, be
careful with ports and new code, and remember - it's not paranoia if
they really are out to get you.

 There really isn't much 
 reason to compile your own kernel unless you add your own stuff or want to 
 change something.

Of course, that's still true.

Joachim



Re: Encrypting files

2006-07-02 Thread Joachim Schipper
On Sun, Jul 02, 2006 at 03:59:41PM -0400, Nick Guenther wrote:
 On 7/2/06, Peter Philipp [EMAIL PROTECTED] wrote:
 On Sun, Jul 02, 2006 at 02:56:03PM -0400, Nick Guenther wrote:
  How can you make a keylogger on UNIX?
 I think this was meant. (...)
 Ah, okay, thank you! I see a lot go across on this list only
 half-explained, which is good for those who know what is going on but
 not for newbies like me.
 
 It's nice that this list is the sort of place where you are expected
 to use your own morals instead of blindly following the no hacking is
 bad! mantra. For the record, I was just curious, I'm not actually
 planning on bugging my systems.

Note that, under certain circumstances, it can make sense to bug your
own systems, and in most (all?) jurisdictions it is legal if the users
are warned beforehand.

This can make sense if you run a shell provider, and d00m10rd_t3h_1337
is running another ssh scan, for instance...

Plus, you need at least a high-level theoretical knowledge of an attack
to be able to adequately defend yourself from it.

Joachim



Re: Encrypting files

2006-07-02 Thread Peter Philipp
On Sun, Jul 02, 2006 at 10:25:35PM +0200, Joachim Schipper wrote:
 Well, provided the BIOS (or equivalent) cannot be flashed from the
 kernel, yes.
 
 Of course, worrying about this requires raging paranoia. But from a

Paranoia isn't necessarily a bad thing.  It motivates people to seek true or 
possible points of compromise in a system.  Motivation is the key in 
productivity and security.

-peter



Re: Encrypting files

2006-07-02 Thread Travers Buda
On Sun, 2 Jul 2006 10:57:42 -0600
Chris Kuethe [EMAIL PROTECTED] wrote:

 Bear in mind that if you're serious about keeping plaintext away from
 people who you don't want to see it, this could get quite tricky.

After a bout of homocidal paranoia and time spent wondering just what
to do with several hundred pounds of tin foil...

Crypted data is good. It will stop snooping office workers and common
laptop thieves. But if some organization wants your data, they could
trick it out of you (keyloggers, et al.) Or more crude physical methods.

I once advocated some insane crypto here, which was indeed silly of me.
I have seen the light. svnd is a fantastic _practical and real_
solution. I'm happy that there is such a fantastic OS for me to run...
though I wonder what I will do 60 years down the line. 

Anyhow, thanks for the great OS guys. When can I buy the next release?
=)

Travers



Encrypting files

2006-07-01 Thread Rico Secada
Hi

I have been thinking about encrypting some private files on my laptop, in case 
it gets stolen.

I have no prior experience in this field.

I have been thinking about using mcrypt with blowfish, but is this a good way 
to go about? Are there a better alternative? And is blowfish the best way to 
encrypt it?

Please bear with me if these questions are ignorent.

Best regards,
Rico



Re: Encrypting files

2006-07-01 Thread Peter Philipp
On Sun, Jul 02, 2006 at 02:14:59AM +0200, Rico Secada wrote:
 Hi
 
 I have been thinking about encrypting some private files on my laptop, in 
 case it gets stolen.
 
 I have no prior experience in this field.
 
 I have been thinking about using mcrypt with blowfish, but is this a good 
 way to go about? Are there a better alternative? And is blowfish the best way 
 to encrypt it?
 
 Please bear with me if these questions are ignorent.
 
 Best regards,
 Rico

I use openssl if I have to encrypt a file, it's fairly portable across 
systems.

$ echo supersecretcontent  file
$ openssl enc -bf-cbc -in file -out file.X
enter bf-cbc encryption password:
Verifying - enter bf-cbc encryption password:
$ hexdump -C file.X
  53 61 6c 74 65 64 5f 5f  48 bf cb c8 f0 42 b0 35  |Salted__H?KHpB05|
0010  ba 2a 39 32 e6 63 92 a4  52 78 b1 f8 ce 09 ac 6e  |:*92fc.$Rx1xN.,n|
0020  d0 e7 6a e6 26 0d 48 b0   |Pgjf.H0|
0028
$ # this is important afterwards
$ rm -P file
$

-peter


-- 
Here my ticker tape .signature  My name is Peter Philipp  lynx -dump 
http://en.wikipedia.org/w/index.php?title=Pufferfisholdid=20768394; | sed -n 
131,136p  So long and thanks for all the fish!!!



Re: Encrypting files

2006-07-01 Thread Travers Buda
On Sun, 2 Jul 2006 02:14:59 +0200
Rico Secada [EMAIL PROTECTED] wrote:

 Hi
 
 I have been thinking about encrypting some private files on my
 laptop, in case it gets stolen.

tedu just improved svnd's crypto... add -K option which uses a salt
file and pkcs5 pbkdf2 to create a more secure key...

Thanks tedu djm and markus!

Travers



Re: Encrypting files

2006-07-01 Thread Paul de Weerd
On Sun, Jul 02, 2006 at 02:14:59AM +0200, Rico Secada wrote:
| Hi
|
| I have been thinking about encrypting some private files on my
| laptop, in case it gets stolen.

If someone can steal your laptop, can they also take it for a short
while, fiddle with it (eg install a malicious kernel) and return it to
you without noticing, only to come by later to steal it again ?

Consider this, because in such a case your private files may get
exposed while you think you are secure.

| I have no prior experience in this field.
|
| I have been thinking about using mcrypt with blowfish, but is this
| a good way to go about? Are there a better alternative? And is
| blowfish the best way to encrypt it?

Apaart from the other suggestions already mentioned, you could try
using security/gnupg :

gpg -e  INPUTFILE  OUTPUTFILE
rm -P INPUTFILE
gpg  OUTPUTFILE

Good luck.

Paul 'WEiRD' de Weerd

--
[++-]+++.+++[---].+++[+
+++-].++[-]+.--.[-]
 http://www.weirdnet.nl/

[demime 1.01d removed an attachment of type application/pgp-signature]