How to use Python to decrypt files encrypted using Vim's cryptmethod=blowfish2?
<p>I would like to use Python to decrypt files encrypted using Vim encrypted with the <a href="http://vim.wikia.com/wiki/Encryption" rel="nofollow"><code>cryptmethod=blowfish2</code></a> method. I have not seen the encryption method documented anywhere and would appreciate help in figuring out how to do this.</p>

<p>Is this a standard ability with Python, or has a library been implemented, or other?</p>

<p>Check out this module: <a href="https://github.com/nlitsme/vimdecrypt" rel="nofollow">https://github.com/nlitsme/vimdecrypt</a>. You can use it to decrypt your files, or study the code to learn how to implement it yourself. Example usage:</p>

<pre><code>from collections import namedtuple
from vimdecrypt import decryptfile

args = namedtuple('Args', ('verbose', 'test'))(False, False)
password = 'password'
with open('somefile', 'rb') as somefile:
    decrypted = decryptfile(somefile.read(), password, args)
</code></pre>

python encryption vim blowfish