Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 23 Oct 2014, 12:47
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Security/Privacy
SelfCrypText v2.2
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Author Message
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sat 21 Jan 2012, 17:28    Post subject:  SelfCrypText v2.2
Subject description: Simple Bash+Gtkdialog text encryption tool
 

Once upon a time I've seen an interesting text encryption tool under Windoze.
That tool had ability to put the encrypted text in the application itself, and then to save it.
Thanks to it, it was possible to have encrypted text and the tool in one file.

I still feel weak in Bash and Gtkdialog, but I wrote something similar.
The code is a bit overbloated - I'm sure it's possible to optimize/improve it (and it is welcomed).
Also, it would be more secure to use variables instead files to keep temporary data,
but I couldn't find a way to do it in Gtkdialog...

SelfCrypText can be used in two ways:
1. As standard text encryption tool, eg.: input_some_text -> encrypt/decrypt -> copy_somewhere_else;
2. As portable, executable container for encrypted text, eg.: input_some_text -> encrypt/decrypt -> save_as;

The second option creates a new copy of application, but the file contains encrypted text also.
When it's launched, the text is displayed instantly and can be decrypted, and the application itself can be reused.

SelfCrypText uses 'openssl' and AES-256 + base64 encryption.
Written on Lupu-528.004.

EDIT:
The latest single-note version (v1.4) is attached HERE.
The latest multi-note version (v2.2) is attached HERE.

Greetings!
SelfCrypText.jpg
 Description   SelfCrypText screenshots
 Filesize   60.67 KB
 Viewed   1574 Time(s)

SelfCrypText.jpg

SelfCrypText.tar.gz
Description  SelfCrypText - unpack and launch by clicking on it.
gz

 Download 
Filename  SelfCrypText.tar.gz 
Filesize  1.04 KB 
Downloaded  586 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.

Last edited by SFR on Tue 25 Jun 2013, 10:48; edited 8 times in total
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sat 21 Jan 2012, 22:19    Post subject:  

ipsa scientia potestas est

Well done.
I may use this to encrypt the location of my time machine. At the moment it is stashed in the future and to the right a bit.
For some this will be invaluable Smile

The Growl program in Puppy 5.3.1 (Menu/network)
has the option to encrypt and decrypt a file
using click and drag by and calling the program
/usr/sbin/bcrypt_gui

I believe micko wrote that for Slacko
. . . might be of interest

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
Dave_G


Joined: 21 Jul 2011
Posts: 459

PostPosted: Sun 22 Jan 2012, 04:28    Post subject:  

Nice one SFR.
Don't be concerned with it being bloated, it's not.
I have no doubt that it can be minimized but what advantage would be
gained from it?
It's not like a short GTKdialog is going to bring your CPU to it's knees
and by optimizing it, you may make it less unreadable and more difficult for others
to adapt and modify to their specific needs.

The only change I would make is like you say try and use variables instead
of files for your temp storage.
I don't know enough about GTKdialog to help but try posting here:
http://www.murga-linux.com/puppy/viewtopic.php?t=38608
There will be more then a few users that might be able to help out.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sun 22 Jan 2012, 07:36    Post subject:  

Quo semel est imbuta recens, servabit odorem testa diu.
Optimalization...it's my old habit inherited from the c64, to be concerned about every single bit of free mem and every single cycle of CPU.
And yes, it was a challenge to analyze such code later. Laughing

I'll post this problem at Gtkdialog Tips thread and meanwhile I'll try to find a way to encrypt/decrypt string instead file using openssl - had problem with this too.

Thanks & Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Tue 24 Jan 2012, 07:03    Post subject:  

I did a small security upgrade:

- the temporary file is wiped out instantly after every use in code;
- the temporary file is wiped out using 'shred' instead simple 'rm'.

Greetings!
SelfCrypText_v1.1.tar.gz
Description  SelfCrypText_v1.1 - unpack and launch by clicking on it.
gz

 Download 
Filename  SelfCrypText_v1.1.tar.gz 
Filesize  1.08 KB 
Downloaded  544 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sun 19 Feb 2012, 09:58    Post subject:  

Update: SelfCrypText_v1.2

Another small improvements:
- prevention of encrypting an empty message (such message couldn't be decrypted);
- added file-selector to 'Save As' dialog;
- added opportunity to overwrite an existing file;
- few aesthetic corrections in code.

I think it's the goal I had wish to achieve...
...for now.

Greetings!
SelfCrypText_v1.2.tar.gz
Description  Unpack & click to launch.
gz

 Download 
Filename  SelfCrypText_v1.2.tar.gz 
Filesize  1.21 KB 
Downloaded  565 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Tue 21 Feb 2012, 05:12    Post subject:  

I haven't taken a look at the code but I often use

Code:
VAR=`command`

#and to get the data
command <<< $VAR
#or
echo "$VAR" |command


I wrote a little poor man's steganography tool a while back that would embed any file onto any file... it used a temp file too, but now that I think about it if I used a VAR, I could probably? use ${#VAR} and some integer math instead of stat -c %s to get the size

its here:
http://www.murga-linux.com/puppy/viewtopic.php?t=72807

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Tue 21 Feb 2012, 16:51    Post subject:  

The main problem is the <edit><default> widget in my case.
It doesn't allow to be refreshed if I use a variable or command, the only way is to use <edit><input file> and temporary file.
http://www.murga-linux.com/puppy/viewtopic.php?p=598937#598937
Such temp file is converted into a variable and shredded immediatly and then everything is done with that variable...until the next refresh (which is encrypt/decrypt action).
It's ok with eg. <entry><input>$VAR... (and the password is stored in that way), but this won't allow to use multiple lines...

technosaurus wrote:
http://www.murga-linux.com/puppy/viewtopic.php?t=72807

Nice idea. It has a big advantage over the classic steganography = any kind of files allowed.
I just tried cat some_random_stuff_file >> abiword and dillo binaries, and they still work.
Tried with *.tar.gz also - after decompressing Xarchive shows "Wrapper exited with a error", but unpacked data is untouched!

Thanks & Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
bruno

Joined: 08 Mar 2012
Posts: 70
Location: Belgium

PostPosted: Fri 10 Aug 2012, 06:41    Post subject: how to install?  

How can i install this?
I just know how to install a .pet, but this is not a .pet
If i click on it, it just shows the code.
Thanks
Back to top
View user's profile Send private message 
bruno

Joined: 08 Mar 2012
Posts: 70
Location: Belgium

PostPosted: Fri 10 Aug 2012, 06:45    Post subject:
Subject description: installation
 

I'm using dpup exprimo 3.2.14.2
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Fri 10 Aug 2012, 15:23    Post subject:  

Hey Bruno.

This app is designed to be portable; doesn't need to be installed.

I assume that you unpacked the downloaded file first..?
If so and still nothing I guess that permissions of the file aren't set properly...
In Rox-Filer right-click on the file -> File 'SelfCrypt...' -> Properties and select all boxes under "Exec".

If this won't help, open terminal window in a folder where the file resides, type:
Code:
./SelfCrypText_v1.2

see if there are any errors and let me know how's it going.

HTH
Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
bruno

Joined: 08 Mar 2012
Posts: 70
Location: Belgium

PostPosted: Fri 10 Aug 2012, 19:28    Post subject:  

Thanks SFR,
Now I see how it works.
Very nice little fast app!
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sat 18 Aug 2012, 10:42    Post subject:  

Doh, I just found out that "shred" program isn't included in Slacko. Sad

So, to preserve secure deletion of temporary file, I used this, instead of shred:

Code:
SIZE=`du -b $TEMPFILE | cut -f1`
dd if=/dev/urandom of=$TEMPFILE bs=1 count=$SIZE

I hope dd behaves as I think it does: overwrites exactly the same sectors of a file on the disk..?

Additionaly I did few fixes, the most important was wrong handling of filenames with spaces.

Greetings!
SelfCrypText_v1.3.tar.gz
Description  Unpack & click to launch.
gz

 Download 
Filename  SelfCrypText_v1.3.tar.gz 
Filesize  1.4 KB 
Downloaded  449 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sat 06 Oct 2012, 10:54    Post subject:  

Using Pizzasgood's idea I've applied ramdisk as a storage for temp file.
I believe it's more reasonable way than dabbling with dd and shred.

Dynamic ramdisk has been set to max. 1 MB, but I think it's more than enough.
Additionally since now all data is being gzip'ed before encryption.

Greetings!
SelfCrypText_v1.4.gz
Description  Extract, make executable and click to launch.
gz

 Download 
Filename  SelfCrypText_v1.4.gz 
Filesize  1.37 KB 
Downloaded  728 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6449
Location: Auckland, New Zealand

PostPosted: Mon 08 Oct 2012, 21:55    Post subject:  

Quote:
The second option creates a new copy of application, but the file contains encrypted text also.
When it's launched, the text is displayed instantly and can be decrypted, and the application itself can be reused.

Cool, a stand-alone secret diary Smile

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Security/Privacy
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0888s ][ Queries: 13 (0.0083s) ][ GZIP on ]