Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a command line version for Linux #1

Closed
Wikinaut opened this issue May 16, 2015 · 50 comments
Closed

Make a command line version for Linux #1

Wikinaut opened this issue May 16, 2015 · 50 comments

Comments

@Wikinaut
Copy link

Wikinaut commented May 16, 2015

UPDATE 04.11.2015

  • Coder: binary-file-input -> coder -> coded pdf output (which then can be printed)
  • Decoder: input scanned image (png/tif/pdf) -> decoder -> binary file output

referenced: https://twitter.com/Wikinaut/status/662021070975852544


@Rupan

I am heavily interested in working with/on that software, especially in porting it to Linux/having it ported to Linux, and to use QR codes and the XZing software https://github.com/zxing/zxing for the code boxes (but letting the old decoder in to keep it compatible and allow decoding of old paperba(c)k backups).

Have you perhaps already ported it but forgot to push upstream?

The program should perhaps go together with Paperkey , see http://www.jabberwocky.com/software/paperkey/ and https://gist.github.com/joostrijneveld/59ab61faa21910c8434c .

For later improvements, I suggest also a pure Javascript [sic] version (yes, there are QR javascript code/decode implementations, see http://www.webqr.com/ (live) and the code https://github.com/LazarSoft/jsqrcode ).

Closed on 02.01.2021

@Wikinaut Wikinaut changed the title Are there plans to make a version for Linux ? Are there plans to make a version for Linux, or Javascript ? And to move to use QR codes ? May 16, 2015
@Rupan
Copy link
Owner

Rupan commented May 16, 2015

Short answer: not at the moment. There are several problems, not the least of which is the fact that the user interface definitions are defined in a Borland-specific format that only works on Windows.

Perhaps that could be some sort of command line application which did the same thing ... but I don't have time to work on it at the moment. If anything, this program should be rewritten from scratch using Python and PyQt.

@Wikinaut
Copy link
Author

@Rupan

There are several problems, not the least of which is the fact that the user interface definitions are defined in a Borland-specific format that only works on Windows.

Should be changed.

this program should be rewritten from scratch using Python and PyQt.

Unfortunately, I am not familiar with these languages.

Okay, but keep informed that I am interested. If you start a "stub" code, I could improve it, write documentation and so on.

@Zorgatone
Copy link

I agree we need a unix port of this 😛

@Zorgatone
Copy link

I'm curious to see how this will progress

@Rupan

@Wikinaut
Copy link
Author

Wikinaut commented Nov 4, 2015

someone must start, removing the Windows-specific stuff and replacing with stubs (for the GUI), so that first a commandline version exists, which does

Coder:

  • binary-file-input -> coded pdf output (which then can be printed)

Decoder:

  • scanned image (png/tif/pdf) -> decoder -> binary file output

For scanning, I recommend to use gscan2pdf (I am co-developer of it).

I do not see any need for a GUI.

@Zorgatone
Copy link

Neither do I

@Wikinaut Wikinaut changed the title Are there plans to make a version for Linux, or Javascript ? And to move to use QR codes ? BOUNTY: 0.25 BTC Are there plans to make a version for Linux, or Javascript ? And to move to use QR codes ? Nov 4, 2015
@Wikinaut Wikinaut changed the title BOUNTY: 0.25 BTC Are there plans to make a version for Linux, or Javascript ? And to move to use QR codes ? [BOUNTY: 0.25 BTC] Make a command line version for Linux Nov 4, 2015
@Wikinaut
Copy link
Author

Wikinaut commented Nov 6, 2015

@Rupan @Zorgatone can you help?

@Zorgatone
Copy link

I'm not good with WinApi and TWAIN scan/print 😢

@Wikinaut
Copy link
Author

Wikinaut commented Nov 6, 2015

@Zorgatone the first thing is to get rid of GUI and all direct input / output. Just read from file and write to file.

@Rupan
Copy link
Owner

Rupan commented Nov 7, 2015

At the moment I don't have the time or energy to produce such a port. Also, 0.25 bitcoins isn't enough ... perhaps 2 - 3 bitcoins is a more reasonable number.

@Wikinaut
Copy link
Author

Wikinaut commented Nov 7, 2015

@Rupan Yep, you are right, but I wanted to make a first bid.

I looked into the code, and found also assembler code in it, and you compiled parts in extra projects (libs). So, if someone (you?) really can help, I will increase my bounty significantly.

As said: a GUI is not necessary, a mere command line version which compiles on my Linux box, and which can later be extended, will fit.

@Rupan
Copy link
Owner

Rupan commented Nov 9, 2015

The precompiled bits are 3rd party libraries (including the assembly code you mention). Correctly building the Gladman AES and SHA code using the Borland C compiler is somewhat nontrivial, so I did it once and used the static libraries to produce the final Paperbak builds. The interesting bits which perform the data coding are all distributed in source form.

I am a software engineer, so my day job involves writing and maintaining code. Writing additional code after I come home from work is a labor of love, and has to be something I am very interested in since it takes time away from my family.

@Wikinaut
Copy link
Author

Wikinaut commented Nov 9, 2015

I am going to increase my bounty if someone shows up showing real interest to port (migrate) to a Linux command line version (gcc complier suite), code which can be later improved by others.

@HASDYI
Copy link

HASDYI commented Nov 9, 2015

@Wikinaut I am interested. How can we get in touch?

@HASDYI
Copy link

HASDYI commented Nov 16, 2015

@Wikinaut Still interested...

1 similar comment
@HASDYI
Copy link

HASDYI commented Nov 19, 2015

@Wikinaut Still interested...

@Zorgatone
Copy link

Did he die? 😝

@HASDYI
Copy link

HASDYI commented Nov 20, 2015

It seems so 😭

@Wikinaut
Copy link
Author

@HASDYI @Zorgatone I'm back, not dead. Need now to find a way to handle "multiple" solutions (regarding the bounty), so what to do if two of you come up with a working solution ?

@HASDYI what is your previous work, and your experience ? Your github account https://github.com/HASDYI does not show any activity yet.

@Zorgatone
Copy link

Zorgatone commented Nov 21, 2015 via email

@Wikinaut
Copy link
Author

@Zorgatone ok, I understand. Until we have a working solution, look to what i have started: https://github.com/Rupan/paperbak/wiki .

@Zorgatone
Copy link

Zorgatone commented Nov 21, 2015 via email

@HASDYI
Copy link

HASDYI commented Nov 26, 2015

@Wikinaut Apologies for the delay, this github account is used to remain anonymous for various personal reasons. I have been a developing software since 2006 and professionally for the past 5 years. I have a special interest in security and electronics. I have a good understanding of Linux and cross platform C++ development (specifically between Windows and Linux (have not done C++ development for OSX)). In terms of quality of the result, you will have to take my word for the fact that you will greatly impressed.

To minimize your risk in terms of the bounty, I'm sure we can come up with an exchange mechanism once the project is complete.

@HASDYI
Copy link

HASDYI commented Nov 26, 2015

@Wikinaut If you would like, please provide me with your public PGP key. We can then arrange a secure channel to communicate.

@Wikinaut
Copy link
Author

@HASDYI ok, I understand.

I suggest you first read what I compiled here: https://github.com/Rupan/paperbak/wiki as reference and overview about existing and similar programs, so that we are on about the same level.

The I suggest you clone https://github.com/Rupan/paperbak to your own github repo, where we then can exchange our ideas/bug reports about the code.

When submitting changes please keep in mind, that when you submit your code to Github, the git config settings contain at least a user.name and user.email .

Please keep in mind that my bounty is voluntary, and I do not' want to use the formal "bountysource" way ( https://www.bountysource.com/ ), because they take some percentages as fees. On the other hand, I shall indeed increase the bounty.

Regarding the channel, I have to think about how we can do this.

@Zorgatone
Copy link

Also please, try to keep the "crossplatform cli" version of the program compatible with the original 😄

@Wikinaut
Copy link
Author

@Zorgatone Yes. A "must have" is compatibility.

@HASDYI code for controlling a scanner can perhaps be "borrowed" from the http://gscan2pdf.sourceforge.net/ project.

@HASDYI
Copy link

HASDYI commented Nov 27, 2015

@Wikinaut Please send your PGP public key so we can discuss. We can use the issue at HASDYI#1 as a platform for now

@Wikinaut
Copy link
Author

Wikinaut commented Dec 2, 2015

Am 27.11.2015 um 09:29 schrieb HASDYI:

Please send your PGP public key so we can discuss.

My key is attached, pls. send me your key.
Usually I respond immediately, but the last days were very busy. Sorry.

@fdobrovolny
Copy link

fdobrovolny commented Nov 29, 2016

Hey all, I just came across this amazing project and I want it on linux. So can I dig in or somebody already have done so?

@Wikinaut
Copy link
Author

As fas as I know, nobody has started re-coding to Linux yet.

@Rupan
Copy link
Owner

Rupan commented Nov 30, 2016

I don't see what the big deal is regarding native Linux support. The binary application executable is self-contained and runs well under WINE. Why not just use it?

@Rupan
Copy link
Owner

Rupan commented Nov 30, 2016

The graphical UI is designed in a proprietary IDE which costs quite a lot of money to purchase, is infrequently updated, and is not F/OSS friendly. The Paperbak code must be linked with proprietary Borland static libraries in order to render the UI, and cannot therefore be compiled or linked by Visual Studio.

@bgklc
Copy link

bgklc commented Nov 30, 2016 via email

@fdobrovolny
Copy link

fdobrovolny commented Nov 30, 2016 via email

@Wikinaut
Copy link
Author

@BrnoPCmaniak Well, go on ! I will sponsor this project (on success only, of course). A part of the code is in Assembler! Must be ported, too.

@Wikinaut
Copy link
Author

Wikinaut commented Nov 30, 2016

@justinbass
Copy link

I am currently interested in this project, but found it to be way out of date in terms of language choice (c and WinApi), not extensible (requiring an obscure compiler and assembly code), poorly documented (no schema or spec), not callable from command-line, not cross-platform, and with a lot of cruft (scanner/printer unnecessary). While Paperbak is an awesome project, many improvements can be made.

So, I am (also) undertaking the effort to completely rewrite this in a modern fashion (Python, backwards-compatibility kept in mind, well-documented Schema, etc.). Repo here: https://github.com/colorsafe/colorsafe

Currently only encoding from cli is supported, and I haven't verified correctness. It's not ready for initial release just yet, but posting here anyways since I believe I've solved most of the hard problems in making this useful for serious archiving, and the Schema is fairly well fleshed out. Any ideas are most definitely welcome at this point.

@fdobrovolny
Copy link

I did some work to port it too https://github.com/BrnoPCmaniak/python-paperbak/ it can encode and decode data into/from blocks, but didn't had time to finish drawing them and reading them from image.

I have to really appreciate @justinbass code it looks much simpler.

@Wikinaut
Copy link
Author

@BrnoPCmaniak @justinbass perhaps you can work together? Let me know, when you have something ready for me for testing.

@surkeh
Copy link

surkeh commented Nov 21, 2017

I've been working on a cross-platform CLI version of this, off and on, with minimal changes to the original. I dropped direct printer, scanner, and GUI support for the same reasons others have. All that remains is to support decryption (we dropped encryption since the encryption used in the original is known to be broken and compression because better alternatives exist) and to make multiple image decryption less finicky. We've tested with a few compilers, as noted in the readme.

https://git.teknik.io/scuti/paperback-cli

@justinbass
Copy link

@Wikinaut, I am basically done with the first step of ColorSafe - encoding produces a printable 100dpi PDF, and after scanning it at 3x resolution, the decoded output is fairly accurate for the single file I tested. Technically my code meets the criteria of your original bounty requirements. However, there were few/no stipulations in the bounty, and my code is extremely fragile and not even v0.1 yet (no image rotations, >gigabyte memory usage, not user friendly, code messy, probably won't work for most files). It's in progress, of course.

I'm not sure what your passing criteria was, but I cannot accept a bounty anyways (due to my employer) - I was going to request you donate it to the Free Software Foundation or post the same bounty for a different project (paperback-cli seems to be closest to the original goal, but I could not get it to work on Cygwin in Win7).

What I would be interested in is if @Rupan posted the related projects (in no particular order) in the PaperBak README to give the successor projects a tiny bit of exposure.

@Wikinaut
Copy link
Author

Wikinaut commented Dec 4, 2017

@justinbass I will try the code/s soon. Thanks.

@Wikinaut
Copy link
Author

Wikinaut commented Dec 7, 2017

@surkeh Thank you for your post here. I will also try your code later.
Do you intend to move the code to github?

@Wikinaut
Copy link
Author

Wikinaut commented Dec 7, 2017

To all of you: I think, all (new) command line code should be

  • backwards compatible (i.e. should allow to read and decode papers which were encoded and printed with the orginal version)
  • compile and run on all Linux systems, not only x86 architecture (i.e. should not use assembler code)
  • should make use of modern encryption and checksum/hash standards
  • should allow input and output in standard formats (tif/png/gif/pbm) - bmp(manys flavours, so support of all bmp will be too difficult and perhaps not needed)); pdf - anything else?

@surkeh
Copy link

surkeh commented Dec 8, 2017

@Wikinaut, had no intention to move it but it is under GPL so feel free to host a mirror on Github. The friend I've been working with asked that I post a list of completed features so I will combine that with a response to your specifications. Our original goal was to rewrite and refactor, as minimally as possible, into a version of paperback that followed the UNIX philosophy. A thorough refactor into maintainable code is our plan for a phase two but feature-complete, crossplatform operation is our current goal.

Backwards compatible

Shall read, decrypt as needed, decompress as needed, and decode scanned images created by Paperback 1.0 and 1.1.

We have all of this except decryption of images decrypted by 1.10. Decrypting images created in 1.0 is painless because the version doesn't have the binary blob. @Rupan, you mentioned you were able to compile Gladman's AES library in Borland C. I've been trying to compile that version in GCC with little luck. Any tips would be appreciated. @justinbass, have you been able to decrypt images created by paperback 1.10? This should work on Linux and Windows but will be limited to x86 until an equivalent to the assembly portion is found or written.

Crossplatform

Shall compile and run on Windows 7+ and Linux.

This is where C is less than ideal but these problems have been solved. Our solution was to use POSIX types and compilers on Windows that have POSIX types available, converting where necessary. Borland has been purged. @justinbass, thanks for giving this a shot on Cygwin. Has been fixed and tested in msys2. This was due to differences in compilers due to unspecified areas of C.

No encryption, no compression

While we do support decryption and decompression for backwards compatibility, we opted for the UNIX way; do one thing and do it well. Highly recommend that gpg is used for safety, maintainability, and composability, as well as for the wealth of options it provides. In a similar vein, programs such as 7z should be used for compression.

Input and output in a standard format

Shall encode BMP images. Shall decode BMP images.

It is straightforward to create and read BMP and BMP-based formats, and scanners can typically create BMPs. For our simplified version, formats that offered additional effects are unnecessary complication that would be better handled through image converters.

@justinbass
Copy link

@surkeh Generally looks to be working now, but I haven't tested it extensively. There are tons of minor problems, like the --help not working, and multipage decoding seemed to output nothing:

./paperback-cli.exe --decode -i a_0001.bmp -o in.txt -p 0

I myself would consider this to pass the bounty requirements. It still needs a lot of polish, but it's generally usable as is.

@Wikinaut
Copy link
Author

ping to all: I'm not away. I am very busy preparing for the 34c3 congress and so on. Will come back later to your paperbak commandline versions in early 2018!

@Wikinaut
Copy link
Author

Wikinaut commented Feb 7, 2018

@surkeh @justinbass please look here: https://github.com/Wikinaut/paperback-cli , yesterday I had the time to try your code, it works. Thank you. There are some issues, but I will help to fix them.

I wanted to send you a first pull-request regarding the Wikinaut/paperback-cli@429f365 , but cannot sign-in to your repo https://git.teknik.io/scuti/paperback-cli , because this service requires an invitation to register.

@Wikinaut
Copy link
Author

Wikinaut commented May 9, 2018

Update: see https://github.com/Wikinaut/paperbackup/blob/patch-1/README.md for another software list (ColorSafe and Paperbak-cli added there).

@Wikinaut Wikinaut closed this as completed Jan 2, 2021
@Wikinaut Wikinaut changed the title [BOUNTY: 0.25 BTC] Make a command line version for Linux Make a command line version for Linux Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants