Monday, February 23, 2009

Adobe PDF V=3 Encryption

The “Encryption” section of the PDF Reference (section 3.5) mentions that when the encryption dictionary entry with a key of /V has a value of 3, then document de/encryption is via “an unpublished algorithm that permits encryption key lengths ranging from 40 to 128 bits.” As far as I can tell, this algorithm is in fact unpublished – by anyone. The closest I could find was a reference to it in one of Dmitri Sklyarov’s 2001 DEFCON slides. Yeah, that Sklyarov, those DEFCON slides. Maybe he described the whole algorithm in his talk, but the DEFCON A/V archives for that year seem to be down. So I sighed, put on my reversing cap, and figured it out.

The standard object-key-derivation algorithm (section 3.5.1, “General Encryption Algorithm”) accepts as inputs the file encryption key, the object number, and the generation number, and produces as out put a key for a symmetric cipher. The “unpublished” algorithm accepts the same inputs and also produces a symmetric cipher key. It presumably could be used with either RC4 or AES as documented for /V values of 1 and 2, although I’ve so far only seen RC4 used.

The unpublished algorithm in use when /V is 3 is as follows (mimicking algorithm 3.5.1):

1. Obtain the object number and generation number from the object identifier of the string or stream to be encrypted. If the string is a direct object, use the identifier of the indirect object containing it. Substitute the object number with the result of exclusive-or-ing it with the hexadecimal value 0x3569AC. Substitute the generation number with the result of exclusive-or-ing it with the hexadecimal value 0xCA96.

2. Treating the substituted object and generation numbers as binary integers, extend the original n-byte encryption key to n + 5 bytes by appending the low-order byte of the object number, the low-order byte of the generation number, the second-lowest byte of the object number, the second-lowest byte of the generation number, and third-lowest byte of the object number in that order, low-order byte first. Extend the encryption key an additional 4 bytes by adding the value "sAlT", which corresponds to the hexadecimal values 0x73, 0x41, 0x6C, 0x54.

3. Initialize the MD5 hash function and pass the result of step 2 as input to this function.

4. Use the first (n + 5) bytes, up to a maximum of 16, of the output from the MD5 hash as the key for the symmetric-key algorithm, along with the string or stream data to be encrypted.

Now hopefully Google will be kind enough to index this in a way that lets other people find it.

64 comments:

  1. Prom dresses act as the main attraction catcher of most women.The cheap prom dresses play the most significant role in winning the prom title. Prom dress should bring out your beauty and compliment your body type. Prom gowns allow women to choose something different every time.Once you have made up your mind on what type of dresses for prom to buy.

    ReplyDelete
  2. Thanks for sharing, much appreciated and useful post, congrat and keep on track!
    Levitra Online

    ReplyDelete
  3. It is a collective practice just before application buy Finpecia en route for treat a number of category disorders.

    ReplyDelete
  4. I cogitate generic Periactin be capable of accomplish it doable in the direction of carry out that.

    ReplyDelete
  5. The forward complete you remind of buy Propecia, to facilitate's enormously fine!

    ReplyDelete
  6. This must be a nice awareness, just like valtrex online, thanks for the forward!

    ReplyDelete
  7. I achieve bear in mind this is achievable in the direction of accomplish it, thanks enormously a lot headed for generic Zithromax.

    ReplyDelete
  8. The author has written an excellent article. You have made your point and there is not much to argue about. It is like the following universal truth that you can not argue with: No truth is universal, everything has its exception. Thanks for the info penis enlargement penis enlargement pills VigRX Plus

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. Have a good day and good luck with your blog. Your post was interesting to read.

    order viagre

    ReplyDelete
  11. Sinemaizlen.com da donmadan film izle en son çıkan sinema izle yeni çıkan filmler vizyondakiler anında sitemizde tek part olarak izleyebilirsiniz.film izle

    ReplyDelete
  12. awesome I put-off buying this for months, despite positive reviews. I tried every free weather app going and eventually decided to take the plunge. Glad I did - easily the most customisable weather widget and clock on caftan and the skins are awesome!

    http://android-fore.blogspot.com/

    ReplyDelete
  13. Thanks i like your blog very much , i come back most days to find new posts like this.
    manhattan locksmith
    ::emergency locksmith

    ReplyDelete
  14. Keep posting them in the future too, I will be waiting for that
    town car taxi service

    ReplyDelete
  15. The blog is to good and informative where i like to discuss about this in my blog thanks for sharing.
    emergency locksmith

    ReplyDelete
  16. Jobs Chat is one of the biggest Indian Job Site so here you will getTamilnadu Govt Jobs 2017so

    ReplyDelete
  17. Check out the best collection of Love Quotes, Status, Wishes, Messages, Greetings, HD Images and poems for marriage anniversary for facebook and Whatsapp that can be sent to your beloved ones at
    HAPPY ANNIVERSARY WISHES FOR COUPLE
    MARRIAGE ANNIVERSARY WISHES FOR HUSBAND
    WEDDING ANNIVERSARY QUOTES FOR HUSBAND
    HAPPY MARRIAGE ANNIVERSARY IMAGES
    WISHES FOR WEDDING ANNIVERSARY
    ANNIVERSARY WISHES AND QUOTES FOR HUSBAND
    HAPPY ANNIVERSARY QUOTES

    ReplyDelete
  18. Mother's Day is an overall event that occurs on different days in spring dependent upon where you live. In numerous countries, Mother's Day is the second Sunday in May. It can be troublesome picking what to do to praise your mom on Mother's Day. The key is to consider what she would require most, and a short time later arrangement to make the day a remarkable one for her.
    https://en.wikipedia.org/wiki/Mother
    https://wishesquotes.org/2017/02/50-lovely-happy-mothers-day-2017-quotes.html

    ReplyDelete
  19. Fancy designer wear our website and resonable price More....
    We Have Some For You In Your Budget For more…..
    Eid Mubarak

    ReplyDelete
  20. Have Lovely and Beautiful Salwar Suit And Many More…
    We Have Some For You In Your Budget For more…
    Plz visit:- Ladies Suit

    ReplyDelete
  21. Happy Mothers Day gifts 2017| Mothers Day 2017 quotes Images Wallpapers

    mothers day 2017
    Happy mothers day 2017
    Mother's day 2017
    Mothers day gifts
    Mothers day gifts 2017
    Mothers day quotes 2017
    Happy mothers day quotes 2017
    Mothers day images
    Happy mothers day images 2017
    mothers day poems 2017
    mothers day cards 2017
    happy mothers day images 2017
    Mothers Day 2017 Images

    mother's day gifts ideas

    Mothers Day 2017 Images Wallpapers

    Mothers Day 2017 Pictures
    Mothers Day 2017

    Mothers Day Gift

    Mothers Day Gift 20107

    Mothers Day Wishes 2017

    Happy Mothers Day 2017 Quotes

    Happy Mother’s Day 2017 Gift Ideas

    Happy Mothers Day 2017 Quotes

    Happy Mothers Day 2017 cards

    mother's day gifts
    mother's day gifts
    happy mothers day quotes 2017

    Mothers Day 2017 Quotes

    Mothers Day 2017 Quotes

    Mother's Day Brunch 2017 Recipes Ideas

    http://www.mothersday2017.co/
    http://www.mothersday2017.co/

    ReplyDelete
  22. Have Lovely and Beautiful Salwar Suit And Many More…
    We Have Some For You In Your Budget For more…
    Plz visit:- Salwar Kameez

    ReplyDelete
  23. Have Lovely and Beautiful Salwar Suit And Many More…
    We Have Some For You In Your Budget For more…
    Plz visit:- Designer Anarkali salwar kameez

    ReplyDelete
  24. Beautiful cloths.Thank you for shear this blog.
    Traditional Bajuband

    ReplyDelete
  25. You can get a Amazing variety of bridal dresses at our sites.
    The dresses are very beautiful to look at and you can pick them up from online shops.
    we have some for you in your budget...
    Bridal Dresses

    ReplyDelete
  26. You can buy from our large and diverse collection of salwar kameez, party wear suits, Bollywood collection, cotton Kurtis, Anarkali suits, Bollywood saree and many other products.....
    We Have Some For You In Your Budget For more…
    Plz visit:- Gown

    ReplyDelete
  27. Salwar suits are the timeless addiction for Indian women and girls. At any auspicious occasion, festival times, wedding ceremonies or related functions, you simply can't miss at least one out of every three women wearing them.for more...
    Plz visit:- Designer Salwar Suit
    Salwar suits are the timeless addiction for Indian women and girls. At any auspicious occasion, festival times, wedding ceremonies or related functions, you simply can't miss at least one out of every three women wearing them.
    Plz visit:- Salwar Suit

    ReplyDelete
  28. Kurtis,Salwar Suit, Saree, Gown, Anarkali Suit online shopping at Stylizone will not disappoint you as it is India's best designer wear selling outlet. visit us at Stylizone and enjoy best quality, stylish products at the best prices.
    Lehenga
    Sarees
    Gown
    Bridal Lehenga
    Pakistani Dress
    Designer Sarees
    Wedding Lehenga
    Salwar Kameez
    Salwar Suit
    Anarkali Suit

    ReplyDelete
  29. You can buy Lehenga, Patiala salwar suits,Anarkali Suit, Gown, Salwar Suit, Saree and get an exquisite design for you. There is something for everyone here. We even offer customized tailoring. Visit at..
    Anarkali Dress
    Punjabi Dress
    Wedding Saree
    Lehenga Choli
    Ghagra Choli
    Silk Saree
    Ladies Suit
    Indian Saree
    Designer Dress
    Bridal Dresses

    ReplyDelete
  30. The Contemporary style of Punjabi suits exclusively available on Stylizone does offer picturesque of luxury, royalty and elegance. Be it flaring or twirling Ghera dress, with the simple clicks thousand of new styles and patterns are available.
    Punjabi Suits
    Designer Kurtis
    Kurtis
    Wedding Dress
    Lehenga
    Saree
    Gown
    Bridal Lehenga
    Pakistani Dress
    Designer Saree

    ReplyDelete
  31. India is the country of culture Festival.People in india are so crazy about festivals.Diwali is the biggest festival of India.It is the Festival Of Lights.
    Christmas is the New Year of Christians.
    Plz visit:- Happy Diwali Images
    Merry Christmas Wishes
    Happy New Year 2017

    ReplyDelete
  32. According to festivities and Seasons, the exemplary styles of fabric do make a heart throbbing impressions in the minds of wearer. We have Lehenga, Wedding Gown visit at..
    Wedding Lehenga
    Salwar Kameez
    Salwar Suit
    Anarkali Suit
    Anarkali Dress
    Punjabi Dress
    Wedding Saree
    Lehenga Choli
    Ghagra Choli
    Silk Saree

    ReplyDelete
  33. Designer clothes are the reflection of personality of a person. It's very necessary to choose the wear according to an ocassion. In India,Designer Bridal Saree are the most obvious choice for the Young Ladies & Girls. Many more Collection is available at our site. For More....
    Ladies Suit
    Indian Saree
    Designer Dress
    Bridal Dress
    Kurti
    Designer Kurti
    Wedding Dresss
    Punjabi Suit

    ReplyDelete
  34. India is a land of varied culture and religion and throughout the year a series of interesting events and festivals take place here. So, it can be expected that if you will ever visit India you will get opportunity to enjoy at least a few such occasions.
    Happy Diwali Images
    Merry Christmas Wishes
    Happy New Year 2018

    ReplyDelete
  35. Thanks for this wonderful post. The information in this article is very helpful to me. Thanks a lot for sharing. Keep blogging.
    Questions to ask your girlfriend
    Best deep questions to ask your girlfriend

    ReplyDelete
  36. The information you have posted is very useful. Thank you for nice and wonderful Information.
    Freshers Job
    Government Job
    Bank Job
    Walk In Drive
    OFF Campus Drive

    ReplyDelete