Thursday, 18 May 2017

Using Python 3 to extract files from an encrypted archive with a password

Recently I needed to use python to extract the contents of a password-protected zip archive and I came across a few issues I thought would be good to document.

Python has a build in zipfile library that is really good at handling zip files, but unfortunately has a few limitations when it comes to encrypted zip files. This is how Python3 can be used to extract a file from an encrypted zip archive:


The first issue that I came across was some unclear documentation for the "open" method of zipfile in Python 3. The open method uses the "pwd" argument to pass the password for the file, but in Python 3 you need to convert this to bytes before calling open. Unfortunately, the library only seems to support CRC-32 based encryption  - meaning that the default linux zip encryption will work, but AES will not. I was also unable to get this to work with 7zip and WinZip.

93 comments:

  1. Replies
    1. WOW WAHT A MEANINGFUL AND HELPFUL BLOG THIS IS !

      304, 3rd Floor, Pratibha Building. Three Petrol pump, Opposite Manas Tower, LBS Rd, Pakhdi, Thane West, Thane, Maharashtra 400602
      Hours:
      Open ⋅ Closes 10PM
      Phone: 091082 38354
      Appointments: excelr.com

      Data Analytics course is Mumbai

      Delete
  2. Information Scientists taking quite a while and need to put a great deal of exertion for setting up their expository surroundings. ExcelR Data Science Courses

    ReplyDelete
  3. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.

    Digital marketing course

    ReplyDelete
  4. You need to be a part of a competition for one of the finest web sites on the internet. I will recommend this internet internet web site!

    ReplyDelete
  5. Thank you so much for sharing this excellent information. I am glad to discover your post.
    Hadoop Training in Hyderabad

    ReplyDelete
  6. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    Data Science Course

    ReplyDelete
  7. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!

    data science course

    ReplyDelete

  8. You have explained the concept really well. Was looking for this information from a while & luckily I stumbled upon your post. Looking forward for more of such informative updates from you

    Data Science Training In Hyderabad
    Data Science Course In Hyderabad

    ReplyDelete
  9. Good Article, the information you provided is helpful for me
    Data Science Training In Hyderabad

    ReplyDelete
  10. Nice post. Thanks for sharing! It’s interesting content and Great work.
    AI Training in Hyderabad

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

    ReplyDelete
  12. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.

    Correlation vs Covariance

    ReplyDelete
  13. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression

    ReplyDelete
  14. Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.

    Data Science In Banglore With Placements
    Data Science Course In Bangalore
    Data Science Training In Bangalore
    Best Data Science Courses In Bangalore
    Data Science Institute In Bangalore

    Thank you..

    ReplyDelete
  15. Really Very Infromative Post , Thanks For Sharing The Information With Us.
    Best AWS Training Institute in Hyderabad

    ReplyDelete
  16. Thank you so much for this incredible guide. This has given me so much information
    AI Training in Hyderabad

    ReplyDelete
  17. This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data scientist courses

    ReplyDelete
  18. This post is great. I reallly admire your post. Your post was awesome.
    data science course in Hyderabad

    ReplyDelete
  19. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression
    data science interview questions

    ReplyDelete
  20. I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.

    data science interview questions

    ReplyDelete
  21. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.

    Simple Linear Regression

    Correlation vs Covariance

    ReplyDelete
  22. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression
    data science interview questions

    ReplyDelete
  23. Thanks for posting useful information.You have provided an nice article,

    AI Training in Hyderabad

    ReplyDelete
  24. I have read your blog and I gathered some new information through your blog.
    Digital Marketing Training in Hyderabad

    ReplyDelete
  25. Thanks For Sharing Such Great Information, It's Really Nice And Informative...

    GMAT online preparation
    GMAT training in hyderabad
    CAT Coaching in hyderabad

    ReplyDelete
  26. This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data science certification

    ReplyDelete
  27. Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.
    data science using python and r programming Guwahati

    ReplyDelete
  28. Thanks for posting useful information.You have provided an nice article,

    Data Science Training in Hyderabad

    ReplyDelete
  29. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.

    AI Training in Hyderabad

    ReplyDelete
  30. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.

    Simple Linear Regression

    Correlation vs covariance

    KNN Algorithm

    Logistic Regression explained

    ReplyDelete
  31. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.

    Simple Linear Regression

    Correlation vs Covariance

    ReplyDelete
  32. I really happy found this website eventually. Really informative and inoperative! Thanks for the post and effort! Please keep sharing more such article.

    AI Training in Hyderabad

    ReplyDelete
  33. And finally, coming to those who have a question, can data science be done by self learning. Well the answer is yes, provided you have the right amount of dedication, drive and passion. data science course in hyderabad

    ReplyDelete
  34. Awesome post i must say and thanks for the information. Thanks again for providing us these unique guidelines it's actually helpful for each person. I appreciate your post and look forward to more. data scientist courses

    ReplyDelete
  35. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Simple Linear Regression
    Correlation vs covariance
    data science interview questions
    KNN Algorithm
    Logistic Regression explained

    ReplyDelete
  36. Awesome post i must say and thanks for the information. Thanks again for providing us these unique guidelines it's actually helpful for each person. I appreciate your post and look forward to more. data scientist courses

    ReplyDelete
  37. Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad

    ReplyDelete
  38. Hey, Wow all the posts are very informative for the people who visit this site. Good work! We also have a Blog.Please feel free to visit our site. Thank you for sharing.

    AI Training in Hyderabad

    ReplyDelete
  39. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.Best data science courses in hyerabad

    ReplyDelete
  40. This post is very simple to read and appreciate without leaving any details out. Great work!
    data science courses

    ReplyDelete
  41. Now, the online store wants to propose product recommendations for each customer based on their past activity. The store got the entire information of the customers like past purchase history, products browsing the history, income, age and some more. data science course syllabus

    ReplyDelete
  42. Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks. Ultimate Encrypted Phone Solutions Chat PGP

    ReplyDelete
  43. Improved Customer Service and Support. Salesforce provides your company with an easy and sustainable way to improve the customer service and support options. Salesforce training in Hyderabad

    ReplyDelete
  44. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!

    data science course in India

    ReplyDelete
  45. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!

    data science course in India

    ReplyDelete
  46. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also.
    Artificial Intelligence Course

    ReplyDelete
  47. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also.
    Artificial Intelligence Course

    ReplyDelete
  48. I’m happy I located this blog! From time to time, students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. nice one
    best data science courses in hyderabad

    ReplyDelete
  49. I recently came across your article and have been reading along. I want to express my admiration of your writing skill and ability to make readers read from the beginning to the end. I would like to read newer posts and to share my thoughts with you.
    data scientist courses

    ReplyDelete
  50. I really appreciate your work and very amazing and important information
    by cognex is the AWS Training in Chennai

    ReplyDelete
  51. Wow, amazing post! Really engaging, thank you.
    data science malaysia

    ReplyDelete
  52. You finished certain solid focuses there. I did a pursuit regarding the matter and discovered essentially all people will concur with your blog. data scientist course

    ReplyDelete
  53. I read your recent article about unemployment in our community and sincerely appreciated its message.
    https://360digitmg.com/hrdf-training

    ReplyDelete
  54. Fantastic blog extremely good well enjoyed with the incredible informative content which surely activates the learners to gain the enough knowledge. Which in turn makes the readers to explore themselves and involve deeply in to the subject. Wish you to dispatch the similar content successively in future as well.

    Data Science Course in Raipur

    ReplyDelete
  55. Thanks for posting the best information and the blog is very helpful.data science interview questions and answers

    ReplyDelete
  56. i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
    best data science courses in bangalore

    ReplyDelete
  57. I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up

    Devops Training in Hyderabad

    Hadoop Training in Hyderabad

    Python Training in Hyderabad

    Tableau Training in Hyderabad

    Selenium Training in Hyderabad

    ReplyDelete
  58. Really impressive post. I read it whole and going to share it with my social circules. I enjoyed your article and planning to rewrite it on my own blog.
    data scientist training and placement in hyderabad

    ReplyDelete
  59. Nice blog. You have provided such a useful information in this blog. Thanks for sharing. AWS Course in Chennai

    ReplyDelete

  60. I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up

    Devops Training in Hyderabad

    Hadoop Training in Hyderabad

    Python Training in Hyderabad

    Tableau Training in Hyderabad

    Selenium Training in Hyderabad

    ReplyDelete
  61. อีกทั้งเรายังให้บริการ เกมสล็อต ยิงปลา แทงบอลออนไลน์ รองรับทุกการใช้งานในอุปกรณ์ต่าง ๆ HTML5 คอมพิวเตอร์ แท็บเล็ต สมาทโฟน คาสิโนออนไลน์ และมือถือทุกรุ่น เล่นได้ตลอด 24ชม. ไม่ต้อง Downloads เกมส์ให้ยุ่งยาก ด้วยระบบที่เสถียรที่สุดในประเทศไทย

    ReplyDelete
  62. Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such an amazing content for all the curious readers who are very keen of being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in future too.

    data science institute in bangalore

    ReplyDelete
  63. อย่างไรก็ตามในการเล่นเกมส์คาสิโนออนไลน์หรือการเดิมพันออนไลน์ชนิดต่างๆคุณจะต้องให้ความสำคัญในเรื่องของการเลือกเว็บคาสิโนออนไลน์เลือกเว็บเดิมพันออนไลน์ที่คุณจะใช้บริการให้ดีคุณจำเป็ สล็อต นที่จะต้องศึกษาและหาข้อมูลเกี่ยวกับเว็บก่อนที่คุณจะตัดสินใจใช้บริการเพื่อความปลอดภัยในการใช้บริการของคุณและเพื่อประโยชน์ในการใช้บริการเว็บที่คุณจะต้องใช้บริการไปอีกนานถ้าคุณใช้บริการเว็บที่ให้บริการที่ดีคุณก็จะมีความสะดวกสบายในการใช้บริการเว็บคาสิโนออนไลน์หรือเว็บเดิมพันออนไลน์ต่างๆ

    ReplyDelete
  64. I really thank you for the valuable info on this great subject and look forward to more great posts
    data scientist training in hyderabad

    ReplyDelete

  65. Great blog found to be well written in a simple manner that everyone will understand and gain the enough knowledge from your blog

    DevOps Training in Hyderabad

    ReplyDelete

  66. Great to become visiting your weblog once more, it has been a very long time for me.

    Pleasantly this article i've been sat tight for such a long time. I will require

    this post to add up to my task in the school, and it has identical subject along

    with your review. Much appreciated, great offer. data science course in nagpur

    ReplyDelete
  67. Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. data scientist course in delhi

    ReplyDelete
  68. Thanks for posting the best information and the blog is very good.digital marketing institute in hyderabad

    ReplyDelete
  69. These thoughts just blew my mind. I am glad you have posted this.
    data scientist training and placement

    ReplyDelete
  70. Thanks for posting the best information and the blog is very good.artificial intelligence course in hyderabad

    ReplyDelete
  71. "Highly professional, and lovely guys! UK Close Protection Services Ltd provided a brilliant service, friendly security chauffeur
    and completely reliable they made me feel comfortable and confident. I would highly recommend their services and will definitely promote and use them again."

    ReplyDelete

AWS Keyspaces - Managed Cassandra review

AWS recently went live with Keyspaces, their managed version of Cassandra ( https://aws.amazon.com/keyspaces/ ). This service is primarily a...