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.

50 comments:

  1. 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
  2. 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
  3. 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
  4. Thank you so much for sharing this excellent information. I am glad to discover your post.
    Hadoop Training in Hyderabad

    ReplyDelete
  5. 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
  6. 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

  7. 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
  8. Good Article, the information you provided is helpful for me
    Data Science Training In Hyderabad

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

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

    ReplyDelete
  11. 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
  12. 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
  13. 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
  14. Really Very Infromative Post , Thanks For Sharing The Information With Us.
    Best AWS Training Institute in Hyderabad

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

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

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

    ReplyDelete
  18. 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
  19. 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
  20. 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
  21. 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
  22. Thanks for posting useful information.You have provided an nice article,

    AI Training in Hyderabad

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

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

    GMAT online preparation
    GMAT training in hyderabad
    CAT Coaching in hyderabad

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

    ReplyDelete
  26. 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
  27. Thanks for posting useful information.You have provided an nice article,

    Data Science Training in Hyderabad

    ReplyDelete
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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

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...