twofaz / origami-pdf

Automatically exported from code.google.com/p/origami-pdf
GNU Lesser General Public License v3.0
0 stars 0 forks source link

pdf.encrypt incompatible character encodings: UTF-8 and ASCII-8BIT #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using Ruby 2 irb

> What steps will reproduce the problem?

require 'origami' pdf = Origami::PDF.read 'tmp/test.pdf' pdf.encrypt( { 'owner_password' => 'owner', 'user_password' => 'user' })

Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT from /Users/adan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/origami-1.2.5/lib/origami/encryption.rb:1094:in compute_user_encryption_key' from /Users/adan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/origami-1.2.5/lib/origami/encryption.rb:1293:incompute_user_password' from /Users/adan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/origami-1.2.5/lib/origami/encryption.rb:1165:in set_passwords' from /Users/adan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/origami-1.2.5/lib/origami/encryption.rb:275:inencrypt'


> What is the expected output? What do you see instead?

No errors and the pdf.encrypted? #=> true

What version of the product are you using? On what operating system?
SO: OSX 10.8.2
Ruby: 2.0.0-p0
origami: 1.2.5

Please provide any additional information below.

Original issue reported on code.google.com by adan.alv...@gmail.com on 7 May 2013 at 6:41

Attachments:

GoogleCodeExporter commented 8 years ago
I re read the source for the gem and tried: 

pdf.encrypt( { owner_passwd: 'owner', user_passwd: 'user' })

that is changing owner_password for owner_passwd

Original comment by adan.alv...@gmail.com on 7 May 2013 at 6:49

GoogleCodeExporter commented 8 years ago
Hello,

it should now be fixed in the latest development tree. Can you confirm this 
works for you? 
If so, I'll bundle a new gem as soon as possible.

--
Guillaume

Original comment by guilla...@security-labs.org on 7 May 2013 at 11:53