19a0a [Solved] Crypting private data - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > Userland Programming & Scripting

Userland Programming & Scripting C, C++, Python, Perl, Shell, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old December 4th, 2011, 15:22
valsorym's Avatar
valsorym valsorym is offline
Member
 
Join Date: Jun 2011
Location: Ukraine
Posts: 419
Thanks: 357
Thanked 20 Times in 17 Posts
Default Crypting private data

Howdy all,
probably each of us has private data (credit card Pin-code, account in email or host server/ssh/root password, in the end phone number Jasmin of erotic escort service ).

In the past (when I used the WIndows OS) I wrote for me a small program encryption of text data using the method of public keys. It was a good program. I used it and after the transition to FreeBSD, using the true emulators/wine tool. All these I have kept on an external hard drive - which soon failed (broken). Now I've lost the source code, software and personal data. (To say there is nothing - a loser).

I now have a question - is it worth to rewrite the program again? Or may have a similar under FreeBSD? How are you hiding from the wife of the phone a your girl friend? (sorry, ... your personal data).

* I've seen a lot of programs - but ruled that the issue for discussion because it "delicate". I would like to do would have been encrypted data securely and the program not was "trojan" (do not send my passwords to developer).

What would you recommend? (* It is desirable for the console).
Thanks.

Last edited by DutchDaemon; December 5th, 2011 at 02:15.
Reply With Quote
  #2  
Old December 4th, 2011, 15:44
fonz's Avatar
fonz fonz is online now
Moderator
 
Join Date: Nov 2008
Location: Apeldoorn, the Netherlands
Posts: 1,554
Thanks: 404
Thanked 270 Times in 239 Posts
Default

FreeBSD offers plenty of encryption facilities: for single files, for partitions or even the entire system.

Fonz
__________________
It's self-perpetuating a parahumanoidarianised.
-- Queen: "Back to Humans" (best song lyric ever)
Reply With Quote
The Following User Says Thank You to fonz For This Useful Post:
valsorym (May 11th, 2012)
  #3  
Old December 4th, 2011, 22:18
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

I use geli(8) with a vnode backed md(4) device.
Reply With Quote
The Following User Says Thank You to aragon For This Useful Post:
valsorym (December 5th, 2011)
  #4  
Old December 5th, 2011, 08:47
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

Handbook: 19.16 Encrypting Disk Partitions

There's also security/truecrypt
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
The Following User Says Thank You to SirDice For This Useful Post:
valsorym (December 5th, 2011)
  #5  
Old December 5th, 2011, 08:57
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,530
Thanks: 424
Thanked 612 Times in 479 Posts
Default

Quote:
Originally Posted by SirDice View Post
Is fuse already fixed for it?
Reply With Quote
The Following User Says Thank You to graudeejs For This Useful Post:
valsorym (May 11th, 2012)
  #6  
Old December 5th, 2011, 09:01
fluca1978 fluca1978 is offline
Member
 
Join Date: May 2010
Posts: 679
Thanks: 28
Thanked 66 Times in 61 Posts
Default

I've tried truecrypt on 9 rc1 over an usb fat32 filesystem and it seems working.
Reply With Quote
The Following User Says Thank You to fluca1978 For This Useful Post:
valsorym (May 11th, 2012)
  #7  
Old December 5th, 2011, 16:38
folivora folivora is offline
Junior Member
 
Join Date: Sep 2010
Location: Finland
Posts: 94
Thanks: 7
Thanked 2 Times in 2 Posts
Default

I am using geli with md to create small crypted partitions.

Works nicely.
__________________
"Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened. Happiness never decreases by being shared" -- Buddha --
Reply With Quote
The Following User Says Thank You to folivora For This Useful Post:
valsorym (December 5th, 2011)
  #8  
Old December 5th, 2011, 16:59
fonz's Avatar
fonz fonz is online now
Moderator
 
Join Date: Nov 2008
Location: Apeldoorn, the Netherlands
Posts: 1,554
Thanks: 404
Thanked 270 Times in 239 Posts
Default

+1 for geli(8).

You can do pretty much anything from creating small encrypted partitions to encrypting the entire system including / and swap.

The handbook has a section on geli (and gbde), but it focuses on encrypting an actual disk partition. For full system encryption search the HOWTO forum; several people have written HOWTOs for this, including The User Formerly Known As Killasmurf. For creating a small encrypted partition contained in a file (similar to a TrueCrypt container) you may want to use geli in conjunction with md(4) as already said by several people. There might be a HOWTO for that too, but don't shoot me if there isn't one (yet).

Fonz
__________________
It's self-perpetuating a parahumanoidarianised.
-- Queen: "Back to Humans" (best song lyric ever)
Reply With Quote
The Following User Says Thank You to fonz For This Useful Post:
valsorym (December 5th, 2011)
  #9  
Old December 7th, 2011, 11:41
bes bes is offline
Junior Member
 
Join Date: Aug 2010
Posts: 95
Thanks: 5
Thanked 32 Times in 28 Posts
Default

Single files security/gnupg1
full disk encryption GELI(8)
a kernel level stacked cryptographic filesystem, which transparently runs on top of existing file systems sysutils/pefs-kmod
Reply With Quote
The Following User Says Thank You to bes For This Useful Post:
valsorym (December 7th, 2011)
  #10  
Old May 4th, 2012, 23:27
valsorym's Avatar
valsorym valsorym is offline
Member
 
Join Date: Jun 2011
Location: Ukraine
Posts: 419
Thanks: 357
Thanked 20 Times in 17 Posts
Default

Hi guys.
It's me, again, and it's my solution this problem (yep tool).
Sorry that I do not listen to all of you, but I think easier to create my solution, than learn other programs.

Note:
1. It only works with Latin alphabet.
2. The program completely fresh - has not yet been tested.


Okay, no big program that allows you to encrypt text files are not very complicated, but rather a reliable method.

In order to create/open an encrypted file, simply run:
% yep <TEXTEDITOR> <FILENAME>
For example:
% yep vim ~/my_first_yep_file

* Use the argument of -w to ask your protection key.
For example:
% yep -w doorways vim ~/my_second_yepfile

To get help:
% yep -i

To change the password and the keyword:
% yep -p ~/yepfile
or
% yep -w my_keyword -p ~/yepfile

During operation, the program will create a directory / tmp / yep that will host the temporary files. For that to change this directory, use the argument of [i]-d [/ i].
For example:
% yep -w doorways -d ~/tmp/ vim ~/yepfile

Directory structure:
Code:
 ~/yep/
      |__ bin/
      |__ doc/
      |__ src/
      |__ ..
      |__ .
Sources:
~/yep/src/yep.c
The full source code with syntax highlighting can be viewed here!

~/yep/src/Makefile
Code:
# Project:          yep
# Date created:     April 22, 2012
# Whom:             valsorym <valsorym.e@gamil.com>

# binary
EXECUTABLE = $(.CURDIR)/../bin/yep

# compiler
CC = cc
CFLAGS = -Wall -std=c99 
LDFLAGS = -O2

# targets
all: $(EXECUTABLE)
$(EXECUTABLE): yep.o
	$(CC) $(CFLAGS) -o $@ $> $(LDFLAGS) 

yep.o: yep.c
	$(CC) $(CFLAGS) -c $>

.PHONY: all clean run install

clean:
	rm -f *.out *.o *.core

run:
	$(EXECUTABLE)

install:
	cp $(EXECUTABLE) ./bin/
P.S. I hope this helps someone too. (It helped you - tell me "thank you". It is not helped - I listen to your criticism! ).
P.P.S. No need to yell at me, I know that to create a bike again - bad! But I want to ..!

Last edited by valsorym; May 21st, 2012 at 23:59.
Reply With Quote
  #11  
Old May 5th, 2012, 01:47
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,928
Thanks: 30
Thanked 1,924 Times in 1,350 Posts
Default

Large amounts of output really belong on something like http://pastebin.com, which will give you a link you can post here.. It's in the forum guidelines.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
The Following User Says Thank You to DutchDaemon For This Useful Post:
valsorym (May 5th, 2012)
  #12  
Old May 5th, 2012, 08:54
bes bes is offline
Junior Member
 
Join Date: Aug 2010
Posts: 95
Thanks: 5
Thanked 32 Times in 28 Posts
Default

Quote:
Originally Posted by doorways View Post
Hi guys.
It's me, again, and it's my solution this problem (yep tool).
Sorry that I do not listen to all of you, but I think easier to create my solution, than learn other programs.

For example:
% yep vim ~/my_first_yep_file
If you just want to edit a text file, you can add Password Protection to a file your editing in vim:
vim -x <FILENAME>
Reply With Quote
The Following User Says Thank You to bes For This Useful Post:
valsorym (May 5th, 2012)
  #13  
Old May 5th, 2012, 11:09
valsorym's Avatar
valsorym valsorym is offline
Member
 
Join Date: Jun 2011
Location: Ukraine
Posts: 419
Thanks: 357
Thanked 20 Times in 17 Posts
Default

Quote:
Originally Posted by bes View Post
If you just want to edit a text file, you can add Password Protection to a file your editing in vim:
vim -x <FILENAME>

Yes, you are right!
But this is just vim editor, but if I will need to use: vi/ee (FreeBSD default editors), emacs, nano (Linux Gentoo default editor) ... etc. I can create yepfile on FreeBSD, for example, use vim
% yep -w doorways vim ~/my_yepfile

and then read (edit) it use nano in my Linux Gentoo
% yep -w doorways nano ~/my_yepfile

So, I can use any others text editors.

But, thank you! I didn't know this about vim

Last edited by DutchDaemon; May 6th, 2012 at 00:40.
Reply With Quote
  #14  
Old May 5th, 2012, 11:11
valsorym's Avatar
valsorym valsorym is offline
Member
 
Join Date: Jun 2011
Location: Ukraine
Posts: 419
Thanks: 357
Thanked 20 Times in 17 Posts
Default

Quote:
Originally Posted by DutchDaemon View Post
Large amounts of output really belong on something like http://pastebin.com, which will give you a link you can post here.. It's in the forum guidelines.
Oh, thanks! This is very interesting.
Now the full source code with syntax highlighting can be viewed here!

Last edited by valsorym; July 29th, 2012 at 19:40.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Samba 3 and private shares ZeWaren Web & Network Services 1 August 31st, 2011 15:06
My own private mailserver? Caliante Off-Topic 10 September 5th, 2010 16:46
Routing between two private networks behind NAT jem Networking 5 November 9th, 2009 12:14


All times are GMT +1. The time now is 00:37.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0