Difference between revisions of "MiscCrypto"

From YobiWiki
Jump to navigation Jump to search
Line 16: Line 16:
 
==Misc==
 
==Misc==
 
===To unlock password-protected pdfs===
 
===To unlock password-protected pdfs===
  +
* PDF documents may have up to 2 passwords:
* apt-get install gs-common xpdf-utils
 
  +
** '''User password''': protects read access to the document, and when no ''Owner password'' is specified, also protects permission settings.
* pdftops -upw <file_password> <file>.pdf -|ps2pdf - <file>_open.pdf
 
  +
** '''Owner password''': protects full access to the document, and protects permission settings (printing, copying...)
You can also do
 
  +
* pdftk secured.pdf input_pw foopass output unsecured.pdf
 
  +
* Use <tt>pdftops</tt> to remove password from a protected PDF. It works with either password, but when both passwords are set, it also works when only the ''user password'' is known (upon condition that permission <tt>allow Printing</tt> is set).
  +
  +
<source lang="bash">
 
apt-get install gs-common xpdf-utils
  +
pdftops -upw <password> <encrypted>.pdf <decrypted>.ps # To generate a PostScript file (e.g. for further editing)
  +
pdftops -upw <password> <encrypted>.pdf -|ps2pdf - <decrypted>.pdf # To generate a new PDF
  +
pdftops -opw <password> <encrypted>.pdf -|ps2pdf - <decrypted>.pdf # When the Owner Password is known...
  +
</source>
  +
  +
* An other solution is to use ''PDF Toolkit'' <tt>pdftk</tt> (<tt>apt-get install pdftk</tt>). However unlike ''pdftops'' this method doesn't work when only ''user password'' is known but both passwords are set.
  +
  +
<source lang="bash">pdftk <encrypted>.pdf input_pw <password> output <decrypted>.pdf</source>
  +
  +
* <tt>pdftk</tt> can also be used to generate protected documents, and specifying permissions.
  +
  +
<source lang="bash">
  +
pdftk <unprotected>.pdf output <protected>.pdf allow Printing owner_pw <ownerpwd> user_pw <userpwd> #Allow HQ printing
  +
</source>
   
 
===pwsafe===
 
===pwsafe===

Revision as of 17:01, 1 October 2008

Under Windows

CryptTool

  • Demonstration and Reference Program for Cryptography + making AES executables
  • freeware

AxCrypt

  • AES-128 File Encryption, Compression and double-click Edit/View for secure document storage on Windows 95/98/ME/NT/2K/XP, locally or remote.
  • GPL

Zip 2 Secure EXE

  • AES-128/192/256 bits File Encryption, Create self-extracting EXE files from zip files
  • freeware

LoopCrypt

Encfs

TrueCrypt

LUKS

Misc

To unlock password-protected pdfs

  • PDF documents may have up to 2 passwords:
    • User password: protects read access to the document, and when no Owner password is specified, also protects permission settings.
    • Owner password: protects full access to the document, and protects permission settings (printing, copying...)
  • Use pdftops to remove password from a protected PDF. It works with either password, but when both passwords are set, it also works when only the user password is known (upon condition that permission allow Printing is set).
apt-get install gs-common xpdf-utils
pdftops -upw <password> <encrypted>.pdf <decrypted>.ps              # To generate a PostScript file (e.g. for further editing)
pdftops -upw <password> <encrypted>.pdf -|ps2pdf - <decrypted>.pdf  # To generate a new PDF
pdftops -opw <password> <encrypted>.pdf -|ps2pdf - <decrypted>.pdf  # When the Owner Password is known...
  • An other solution is to use PDF Toolkit pdftk (apt-get install pdftk). However unlike pdftops this method doesn't work when only user password is known but both passwords are set.
pdftk <encrypted>.pdf input_pw <password> output <decrypted>.pdf
  • pdftk can also be used to generate protected documents, and specifying permissions.
pdftk <unprotected>.pdf output <protected>.pdf allow Printing owner_pw <ownerpwd> user_pw <userpwd>    #Allow HQ printing

pwsafe

To use 'secure ram' (thereby locking the data in memory and preventing it being flushed to disk) you may like to run it setuid root:

$ sudo dpkg-statoverride --update --add --force root root 4755 /usr/bin/pwsafe