Removing drm

From stacky wiki

<protect>Anton</protect>

First get the version of wine needed to run Kindle for PC:

sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.3

Download python 2.7 for windows http://www.python.org/download/. Install with

wine msiexec /i python-2.7.4.msi

Download pycrypto 2.7 for windows (click the "raw" button on https://github.com/saltstack/salt-windows-install/blob/master/deps/win32-py2.7/pycrypto-2.3.win32-py2.7.msi). Install with

wine msiexec /i pycrypto-2.3.win32-py2.7.msi

Download the DRM removal tool from http://apprenticealf.wordpress.com/2012/09/10/drm-removal-tools-for-ebooks/. Install the calibre plugin (follow the instructions in the readme file of the calibre plugin directory). Extract the file Other_Tools/DRM_Key_Scripts/Kindle_for_Mac_and_PC/kindlekey.pyw and run it with python in wine (in C:\Python27)

wine python.exe kindlekey.pyw

Copy the resulting key file kindlekey1.k4i somewhere. Import it into calibre as follows: Preferences > Plugins > File type plugins > DeDRM ... double click or select and click "customize plugin". Then Kindle for Mac/PC ebooks > Import Existing Keyfiles.

Then download and install (on wine) Kindle for PC http://www.amazon.com/gp/kindle/pc.

Other sites that were useful along the way:
http://www.the-digital-reader.com/2012/06/15/how-add-kindle-drm-removal-plugin-calibre/
http://thescienceofdestruction.wordpress.com/2011/08/10/downloading-and-decrypting-adobe-adept-drm-protected-ebooks-on-linux/
http://askubuntu.com/questions/14686/kindle-for-pc-via-wine