Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-28-2006, 09:32 AM
|
#1
|
|
Member
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893
Rep:
|
How to add some bytes to a binary file?
Suppose I have an xxx film %) I don't want anyone to watch it.
First, I rename it to, e.g., "abcdefg".
This almost solves the problem under Windows.
But Linux reads first bytes of a file to determine file type. So I need to add some bytes to the beginning of file (certain amount of bytes, say 4) to make it unreadable for players.
How to do this?
Thanks.
|
|
|
|
02-28-2006, 10:15 AM
|
#2
|
|
Senior Member
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513
Rep:
|
Quote:
|
Originally Posted by kornerr
Suppose I have an xxx film %) I don't want anyone to watch it.
First, I rename it to, e.g., "abcdefg".
This almost solves the problem under Windows.
But Linux reads first bytes of a file to determine file type. So I need to add some bytes to the beginning of file (certain amount of bytes, say 4) to make it unreadable for players.
How to do this?
Thanks.
|
Why not just encrypt the file/directory using gpg then no one can get to it except the holder of gpg passphrase.
|
|
|
|
02-28-2006, 10:31 AM
|
#3
|
|
Member
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893
Original Poster
Rep:
|
No, I don't want encryption, it takes some time, while adding bytes should be a job of a second.
Any other ideas?
Thanks.
|
|
|
|
02-28-2006, 10:33 AM
|
#4
|
|
Senior Member
Registered: Nov 2003
Location: West Sussex, England
Distribution: Gentoo
Posts: 1,457
Rep:
|
dd will do what you want.
|
|
|
|
02-28-2006, 10:45 AM
|
#5
|
|
Senior Member
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513
Rep:
|
Quote:
|
Originally Posted by kornerr
No, I don't want encryption, it takes some time, while adding bytes should be a job of a second.
Any other ideas?
Thanks.
|
Fair enough but any bytes you add can be removed by anyone who knows what they are doing, if it is that important that you do not want anyone to be able to view encryption is the only option.
|
|
|
|
02-28-2006, 10:58 AM
|
#6
|
|
Member
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893
Original Poster
Rep:
|
Quote:
|
dd will do what you want.
|
Any example of how to add 4 bytes to the beginnig of a file and how to remove 4 bytes from the beginning of a file?
Thanks.
PS:
Quote:
|
can be removed by anyone who knows
|
it's only an against-fool protection 
Last edited by kornerr; 02-28-2006 at 10:59 AM.
|
|
|
|
02-28-2006, 11:23 AM
|
#7
|
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
Code:
cat dummy pr0n.avi > Bill.xls
?
I guess I know your second question
hint:man dd
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:03 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|