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

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

Closed
GoogleCodeExporter opened this issue Dec 30, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant