Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #97475 > unrolled thread

Hiding code from intruders, a different slant on an old question

Started bycl@isbd.net
First post2015-10-07 10:38 +0100
Last post2015-10-08 10:33 -0600
Articles 8 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Hiding code from intruders, a different slant on an old question cl@isbd.net - 2015-10-07 10:38 +0100
    Re: Hiding code from intruders, a different slant on an old question "Littlefield, Tyler" <tyler@tysdomain.com> - 2015-10-07 08:00 -0400
    Re: Hiding code from intruders, a different slant on an old question alister <alister.nospam.ware@ntlworld.com> - 2015-10-07 13:05 +0000
      Re: Hiding code from intruders, a different slant on an old question Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-10-07 20:01 -0400
        Re: Hiding code from intruders, a different slant on an old question cl@isbd.net - 2015-10-08 11:28 +0100
      Re: Hiding code from intruders, a different slant on an old question Ian Kelly <ian.g.kelly@gmail.com> - 2015-10-08 08:44 -0600
        Re: Hiding code from intruders, a different slant on an old question alister <alister.nospam.ware@ntlworld.com> - 2015-10-08 15:46 +0000
          Re: Hiding code from intruders, a different slant on an old question Ian Kelly <ian.g.kelly@gmail.com> - 2015-10-08 10:33 -0600

#97475 — Hiding code from intruders, a different slant on an old question

Fromcl@isbd.net
Date2015-10-07 10:38 +0100
SubjectHiding code from intruders, a different slant on an old question
Message-ID<tp5fec-l15.ln1@esprimo.zbmc.eu>
I know questions similar to this are often asked but my reasons for
wanting to do this (and thus ways it can be done) are slightly different.

I have a number of little utility scripts (python and others) which I
use to automate the process of decrypting and displaying things like
files containing passwords.  

The encryption I use is reasonably secure anyway but I'd like to hide
the programs/methods I use so that:-

1 - The encrypted files are not identifiable as encrypted data (the file
command just returns 'data' so they can't be identified by that).  If
there's a script in my ~/bin directory that relates directly to the
files it's obvious they're encrypted.

2 - The method used for encryption isn't obvious, again an obvious
script will show the program I have used.


I *could* write a C program which just exec()'s the required programs,
if they're done separately this would be fairly well hidden but I was
wondering if there's anything more obvious I can do that enables me to
do things easily in Python.


This is for protecting against any possible intruder who has gained
access to my system by breaking an ssh password or stealing my laptop
for example.  It's *not* for hiding code that I'm giving to others,
I'd be quite happy to give the code in question to people who might
want to use it.

-- 
Chris Green
·

[toc] | [next] | [standalone]


#97479

From"Littlefield, Tyler" <tyler@tysdomain.com>
Date2015-10-07 08:00 -0400
Message-ID<mailman.453.1444219246.28679.python-list@python.org>
In reply to#97475
On 10/7/2015 5:38 AM, cl@isbd.net wrote:
> I know questions similar to this are often asked but my reasons for
> wanting to do this (and thus ways it can be done) are slightly different.
>
> I have a number of little utility scripts (python and others) which I
> use to automate the process of decrypting and displaying things like
> files containing passwords.  
>
> The encryption I use is reasonably secure anyway but I'd like to hide
> the programs/methods I use so that:-
>
> 1 - The encrypted files are not identifiable as encrypted data (the file
> command just returns 'data' so they can't be identified by that).  If
> there's a script in my ~/bin directory that relates directly to the
> files it's obvious they're encrypted.
>
> 2 - The method used for encryption isn't obvious, again an obvious
> script will show the program I have used.
>

You have two options here:
1) Use a strong encryption like aes256 etc and don't bother trying to
"hide" the code because it's just a blob of data and they'll not crack it.
2) Encrypt the whole drive if you use something like *nix/*bsd.
The only thing hiding the code will do is make them guess at the method.
But if you use a good method in the firstplace, you shouldn't have any
issues because it's not going to be cracked.

> I *could* write a C program which just exec()'s the required programs,
> if they're done separately this would be fairly well hidden but I was
> wondering if there's anything more obvious I can do that enables me to
> do things easily in Python.
>
>
> This is for protecting against any possible intruder who has gained
> access to my system by breaking an ssh password or stealing my laptop
> for example.  It's *not* for hiding code that I'm giving to others,
> I'd be quite happy to give the code in question to people who might
> want to use it.
>


-- 
Take care,
Ty
http://tds-solutions.net
He that will not reason is a bigot; he that cannot reason is a fool; he that dares not reason is a slave.

[toc] | [prev] | [next] | [standalone]


#97480

Fromalister <alister.nospam.ware@ntlworld.com>
Date2015-10-07 13:05 +0000
Message-ID<mv35a3$v1k$1@speranza.aioe.org>
In reply to#97475
On Wed, 07 Oct 2015 10:38:37 +0100, cl wrote:

> I know questions similar to this are often asked but my reasons for
> wanting to do this (and thus ways it can be done) are slightly
> different.
> 
> I have a number of little utility scripts (python and others) which I
> use to automate the process of decrypting and displaying things like
> files containing passwords.
> 
> The encryption I use is reasonably secure anyway but I'd like to hide
> the programs/methods I use so that:-
> 
> 1 - The encrypted files are not identifiable as encrypted data (the file
> command just returns 'data' so they can't be identified by that).  If
> there's a script in my ~/bin directory that relates directly to the
> files it's obvious they're encrypted.
> 
> 2 - The method used for encryption isn't obvious, again an obvious
> script will show the program I have used.
> 
> 
> I *could* write a C program which just exec()'s the required programs,
> if they're done separately this would be fairly well hidden but I was
> wondering if there's anything more obvious I can do that enables me to
> do things easily in Python.
> 
> 
> This is for protecting against any possible intruder who has gained
> access to my system by breaking an ssh password or stealing my laptop
> for example.  It's *not* for hiding code that I'm giving to others,
> I'd be quite happy to give the code in question to people who might want
> to use it.

The general rule with all forms of encryption is that the method is not 
secret. it is the key that needs to be kept secret.

in the same way that the mechanical principles of the lock on your front 
door are public knowledge, the profile of the key itself (which is needed 
to unlock the door) is unknown.

Example:

With a simple Cesar the method is "shift the alphabet by 'X' characters 
and X is the key

if the key is unknown then the attacker still has to brute force the 
method (admittedly with only 25 options this is not difficult)



-- 
Down with categorical imperative!

[toc] | [prev] | [next] | [standalone]


#97488

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2015-10-07 20:01 -0400
Message-ID<mailman.460.1444262512.28679.python-list@python.org>
In reply to#97480
On Wed, 7 Oct 2015 13:05:07 +0000 (UTC), alister
<alister.nospam.ware@ntlworld.com> declaimed the following:


>With a simple Cesar the method is "shift the alphabet by 'X' characters 
>and X is the key
>
>if the key is unknown then the attacker still has to brute force the 
>method (admittedly with only 25 options this is not difficult)

	But who'd consider that with just one-case and alphabet only...

	At the least include upper, lower, numbers, and basic punctuation --
that will add a few more cycles of computation time to break <G>


	But the other point, yes... The most used encryption systems have
publicly known/reviewed algorithms and rely on the secrecy of the key(s).
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#97500

Fromcl@isbd.net
Date2015-10-08 11:28 +0100
Message-ID<33thec-mat.ln1@esprimo.zbmc.eu>
In reply to#97488
Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
> On Wed, 7 Oct 2015 13:05:07 +0000 (UTC), alister
> <alister.nospam.ware@ntlworld.com> declaimed the following:
> 
> 
> >With a simple Cesar the method is "shift the alphabet by 'X' characters 
> >and X is the key
> >
> >if the key is unknown then the attacker still has to brute force the 
> >method (admittedly with only 25 options this is not difficult)
> 
>         But who'd consider that with just one-case and alphabet only...
> 
>         At the least include upper, lower, numbers, and basic punctuation --
> that will add a few more cycles of computation time to break <G>
> 
> 
>         But the other point, yes... The most used encryption systems have
> publicly known/reviewed algorithms and rely on the secrecy of the key(s).

Which makes a nonsense of using a super-secure algorithm in many cases.

If you are doing in-place symmetric file encryption then it's the
security of the key hashing algorithm that matters much more than the
actual encryption used on the file.

Using ccrypt, enc, etc. for file encryption means the password that
encodes the encryption key is saved with the file so brute-force
attacks to get the key are quite straightforward.

-- 
Chris Green
·

[toc] | [prev] | [next] | [standalone]


#97508

FromIan Kelly <ian.g.kelly@gmail.com>
Date2015-10-08 08:44 -0600
Message-ID<mailman.479.1444315530.28679.python-list@python.org>
In reply to#97480
On Wed, Oct 7, 2015 at 6:01 PM, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
> On Wed, 7 Oct 2015 13:05:07 +0000 (UTC), alister
> <alister.nospam.ware@ntlworld.com> declaimed the following:
>
>
>>With a simple Cesar the method is "shift the alphabet by 'X' characters
>>and X is the key
>>
>>if the key is unknown then the attacker still has to brute force the
>>method (admittedly with only 25 options this is not difficult)
>
>         But who'd consider that with just one-case and alphabet only...
>
>         At the least include upper, lower, numbers, and basic punctuation --
> that will add a few more cycles of computation time to break <G>

It doesn't really matter how much you add; any Caesar cipher is going
to fall easily to just a little bit of frequency analysis. Consider an
extreme case, where the range of X is the size of the entire Unicode
character set. If the message is written in a Latin-based character
set, chances are good that the majority of the characters will fall
within a range of <96, giving the attacker a great starting point to
brute-force from.

[toc] | [prev] | [next] | [standalone]


#97513

Fromalister <alister.nospam.ware@ntlworld.com>
Date2015-10-08 15:46 +0000
Message-ID<mv634o$pk4$1@speranza.aioe.org>
In reply to#97508
On Thu, 08 Oct 2015 08:44:43 -0600, Ian Kelly wrote:

> On Wed, Oct 7, 2015 at 6:01 PM, Dennis Lee Bieber
> <wlfraed@ix.netcom.com> wrote:
>> On Wed, 7 Oct 2015 13:05:07 +0000 (UTC), alister
>> <alister.nospam.ware@ntlworld.com> declaimed the following:
>>
>>
>>>With a simple Cesar the method is "shift the alphabet by 'X' characters
>>>and X is the key
>>>
>>>if the key is unknown then the attacker still has to brute force the
>>>method (admittedly with only 25 options this is not difficult)
>>
>>         But who'd consider that with just one-case and alphabet only...
>>
>>         At the least include upper, lower, numbers, and basic
>>         punctuation --
>> that will add a few more cycles of computation time to break <G>
> 
> It doesn't really matter how much you add; any Caesar cipher is going to
> fall easily to just a little bit of frequency analysis. Consider an
> extreme case, where the range of X is the size of the entire Unicode
> character set. If the message is written in a Latin-based character set,
> chances are good that the majority of the characters will fall within a
> range of <96, giving the attacker a great starting point to brute-force
> from.

Oh please
the Caesar cypher was mentioned as a simplification for the purpose of 
demonstration.
it was not intended to be even a remotely serious suggestion

which I am sure at least Denis understood when he posted his tongue in 
cheek reply.


-- 
Economists can certainly disappoint you.  One said that the economy would
turn up by the last quarter.  Well, I'm down to mine and it hasn't.
		-- Robert Orben

[toc] | [prev] | [next] | [standalone]


#97515

FromIan Kelly <ian.g.kelly@gmail.com>
Date2015-10-08 10:33 -0600
Message-ID<mailman.487.1444322066.28679.python-list@python.org>
In reply to#97513
On Thu, Oct 8, 2015 at 9:46 AM, alister
<alister.nospam.ware@ntlworld.com> wrote:
> Oh please
> the Caesar cypher was mentioned as a simplification for the purpose of
> demonstration.
> it was not intended to be even a remotely serious suggestion
>
> which I am sure at least Denis understood when he posted his tongue in
> cheek reply.

I understood that also. I don't see why that means I can't elaborate on it.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web