In my Python web application, I will need to decrypt a file that has been encrypted using VIM. Assuming the web application knows the password used to encrypt the file in VIM, how do I write code to decrypt it?
It turns out that vim uses the same encryption as PKZIP:
from zipfile import _ZipDecrypter fp = open(somefile, 'rb') zd = _ZipDecrypter(somekey) fp.read(12) print ''.join(zd(c) for c in fp.read()) fp.close()
I wrote a tool for this, also supporting more advanced encryption methods:
https://github.com/nlitsme/vimdecrypt
Source: https://habr.com/ru/post/1734516/More articles:Remove from tablename takes abnormally long - sql-serverКак получить значение конкретной переменной формы с помощью JQuery - jqueryImage.FromStream does not contain a link to the underlying stream - c #Deadlock occurs in static variables with the Scoped function (Thread Unsafe in VC ++) - c ++How to do dynamic downcasting in vb.net? - .netLong delay between two consecutive KeyDown events - winformsXML file and text files! - xmlColumnDefinition MinWidth does not work correctly - cssJava: The usual practice of creating a new thread when blocking? - javaHow to copy selected items from one list to another when a button is clicked in C # net? - c #All Articles