Clear candidate passwords from memory using ctypes
Clear candidate passwords from memory using ctypes

Without the clearing of candidate passwords, they remain in memory even
after all operations utilizing them have completed. This allows an
attacker with access to the memory or swapfile of the host machine to
view the candidate passwords in plaintext.

Python doesn't allow for the sufficient level of low level control to
manage the manipulation of strings in memory, so the clearing is
achieved through libc.

A writeup about this is located at
https://web.archive.org/web/20100929111257/http://www.codexon.com/posts/clearing-passwords-in-memory-with-python.

lasa/website,lasa/website,lasa/website