LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2023, 11:59 AM   #31
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,856
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869

If this is meant to prove authorship, then it won't work: anyone can add anything into a text-file.
 
1 members found this post helpful.
Old 04-17-2023, 01:00 PM   #32
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
I really hope that the “voodoo code” isn’t intended to be executeble. That would be a security nightmare.
 
Old 04-19-2023, 01:28 PM   #33
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
the code that is added to other code is intended to have no effect. this can be achieved as strictly being comments. the contents of these comments will be keys and the like or marker to source in a way that if no effort is made to remove what is added it can still be used as if nothing was added. for instance this can be a certificate marking the code as a licensed copy.
 
Old 04-19-2023, 04:54 PM   #34
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Then the point stands that you can just do a "find -exec echo >>" operation for each file extension.

The point that "If this is meant to prove authorship, then it won't work" also stands.

Last edited by dugan; 04-19-2023 at 05:01 PM.
 
1 members found this post helpful.
Old 04-20-2023, 12:13 AM   #35
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
to have a reliable mechanism to validate the files you need to do much more, inserting a voodoo line is not enough.
google for certified archives (if you wish)
 
1 members found this post helpful.
Old 04-20-2023, 05:02 PM   #36
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
if the files are valid (instances of that language) they should still be valid after adding the lines. insertion in the middle is not a requirement. adding in the front or back (one of) is all that is needed. once the code is extracted, then it "proves" whatever it was meant to "prove". that may, for example, prove the identity of whoever added those lines (by means of the lines containing something particular that is encrypted by that entity using some PKC).
 
Old 04-20-2023, 07:00 PM   #37
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Skaperen View Post
if the files are valid (instances of that language) they should still be valid after adding the lines. insertion in the middle is not a requirement. adding in the front or back (one of) is all that is needed. once the code is extracted, then it "proves" whatever it was meant to "prove". that may, for example, prove the identity of whoever added those lines (by means of the lines containing something particular that is encrypted by that entity using some PKC).
But the point others have made is that it does not prove the identity of whoever added those lines, it only proves that someone added those line (which they may have copied from elsewhere).

As stated above:

Quote:
Originally Posted by NevemTeve View Post
If this is meant to prove authorship, then it won't work: anyone can add anything into a text-file.
 
Old 04-21-2023, 12:17 AM   #38
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,781

Rep: Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198
Quote:
Originally Posted by dugan View Post
Then the point stands that you can just do a "find -exec echo >>" operation for each file extension.

The point that "If this is meant to prove authorship, then it won't work" also stands.
In find the >> would redirect any output to one file.
You need a shell script that does the >> for each filename.
You can -exec an embedded shell code:
Code:
find . -type f -exec /bin/bash -c '
# shell code with the >>
' scriptname {} +
And put a shell code like I suggested in my previous post.
 
Old 04-21-2023, 01:23 AM   #39
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
Quote:
Originally Posted by Skaperen View Post
if the files are valid (instances of that language) they should still be valid after adding the lines. insertion in the middle is not a requirement. adding in the front or back (one of) is all that is needed. once the code is extracted, then it "proves" whatever it was meant to "prove". that may, for example, prove the identity of whoever added those lines (by means of the lines containing something particular that is encrypted by that entity using some PKC).
Not only anyone can add lines like that to any text file(s), but the same way anyone can alter those files by modifying something important inside.
The problem is that you don't know who added those voodoo lines to the file, when, and if the file was actually intact otherwise. You cannot verify that the voodoo code is actually valid.
So you should make sure that any [illegal] changes to the files will automatically invalidate the certificate (otherwise the method is useless).

Last edited by pan64; 04-21-2023 at 01:24 AM.
 
Old 04-21-2023, 09:06 AM   #40
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by NevemTeve View Post
Maybe you mean `signature`?
We now know the answer is yes. The stated use case is what GPG signatures are for.

And let’s be clear: “I need to add stuff to files and check that stuff later” is not a use case. “I need to prove authorship of a file” is.

https://www.techrepublic.com/article...inux-with-gpg/

Last edited by dugan; 04-21-2023 at 09:07 AM.
 
Old 04-21-2023, 12:28 PM   #41
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by dugan View Post
We now know the answer is yes. The stated use case is what GPG signatures are for.

And let’s be clear: “I need to add stuff to files and check that stuff later” is not a use case. “I need to prove authorship of a file” is.

https://www.techrepublic.com/article...inux-with-gpg/
it can be that but it is not limited to that. it can be used for supplementary data.
 
Old 04-21-2023, 02:37 PM   #42
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Look, I don’t really know why you’re still posting. If you just wanted a quick, foolproof way to add comments to source code files, we’ve given you that.

Last edited by dugan; 04-22-2023 at 01:00 PM.
 
1 members found this post helpful.
Old 04-22-2023, 04:29 AM   #43
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
Quote:
Originally Posted by Skaperen View Post
it can be that but it is not limited to that. it can be used for supplementary data.
and we still don't know what is your real goal. You can put whatever you want in your files. But why?
 
1 members found this post helpful.
Old 04-22-2023, 06:14 PM   #44
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by pan64 View Post
and we still don't know what is your real goal. You can put whatever you want in your files. But why?
suppose uuencode did not exist and i was designing something to make it easy to include a binary file in email. would you still wonder why?

the idea is to be able to attach a small amount of data to a file that in the context of the file, does not affect the file, but can still be recognized as being there, extracted, decoded, (if needed), etc.

my desire at this point is to explore ways to look like comments in a large scope of programming languages. for example, one can begin a line with "#" in Bash or Python (and other languages) to make a comment.
 
Old 04-22-2023, 07:02 PM   #45
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by Skaperen View Post
suppose uuencode did not exist and i was designing something to make it easy to include a binary file in email. would you still wonder why?
But uuencode does exist, and if you were trying to reinvent it we'd tell you to use base64.

Now...

Are you being deliberately vague (to avoid revealing proprietary information, or because you don't want your idea stolen, or whatever), or is this actually how well-formed and specific your idea actually is?

(Earlier, I actually stopped myself from wondering out loud if you this was a scheme to hide your porn collection).

Last edited by dugan; 04-22-2023 at 07:43 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What are the top few most human-readable programming languages? punchy71 Programming 46 01-11-2023 02:17 PM
LXer: How To Print Files Without Comments And Empty Lines In Linux LXer Syndicated Linux News 0 07-01-2020 02:57 AM
Request: Slackware Info-Zip ZipNote be patched to support writing back comments ruario Slackware 0 04-24-2014 12:44 PM
[SOLVED] Add lines end of file above the end comments bkone Programming 2 02-27-2012 09:58 AM
languages of linux: which languages can be choosen in suse and red-hat distributions? Klaus Schnorr Linux - Software 3 09-10-2005 02:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration