[dm-crypt] No key available with this passphrase

Arno Wagner arno at wagner.name
Mon Jun 10 22:55:32 CEST 2013

On Mon, Jun 10, 2013 at 11:40:52PM +0800, Packets wrote:
> Hi Guys,
> I insert my encrypted usb flash drive and mount it on my ubuntu
> workstation. When it was mounted, I tried to format the usb fd using
> gparted gui but it did not succeed so I proceed in putting my data on the
> mounted usb fd. After putting all my data, I reformat the pc and when it
> boot up, I insert the encrypted usb fd. To my surprise, it is no longer
> accepting my passphrase (surprise!). I'm sure my passphrase is correct.
> Could anyone on the list help me recover my files?  Here are some commands
> might be relevant to my problem
> nelson at kazekage:~$ sudo cryptsetup luksOpen /dev/sdb1 test
> [sudo] password for nelson:
> Enter passphrase for /dev/sdb1:
> No key available with this passphrase.

So it is a LUKS device.

> ##################
> nelson at kazekage:~$ sudo cryptsetup isLuks /dev/sdb1
> [sudo] password for nelson:
> nelson at kazekage:~$

This should be run with a "-v" if done interactively.
But your device is a LUKS device, therwise it would
not get as far as it does in luksOpen.

If the keyslot-checker does not find anything (and from what you
describe, it should probably not, just install the library of 
1.6.1 as well to get t working as Milan described), it is possible 
that you have a keymap or charset problem, see FAQ 
item 1.2. This can happen, for example, when your old system used
some ASCII-Extension, and the new one uses UTF-8 (or the other
way round). The gist of it is that you can have characters
that look exatly the same on-screen, but are represented 
differently in binary, for the case of UTF-8 even with 
several bytes instead of the one ASCII byte. This can
happen for all characters not in 7 bit ASCII 
(http://en.wikipedia.org/wiki/ASCII). For example, a German
u-Umlaut (ü in HTML) is 0xfc in ISO/IEC 8859-1,
but 0xc3 0xbc in UTF-8. Thse do of course map to entirely
different binary passphrases.

If you suspect somethng like this happening, you can try to
change the default encoding. 

Or you can try create the right passphrase with a hex-editor
and have cryptsetup read it from file. There are some
details that matter, see the man-page. You may also want to try
it out wth a loop-mountes test LUKS container, see FAQ
item 2.4 on how to make one.
An UTF8 table is here:
and the ISO tables are here:

This problem has already bitten several people, hence
the warning in the FAQ. Debian (and derived distros
like Ubuntu, Mint, ...) has recently switched to UTF-8 
as default from the plder default ISO tables.


Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: arno at wagner.name
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
There are two ways of constructing a software design: One way is to make it
so simple that there are obviously no deficiencies, and the other way is to
make it so complicated that there are no obvious deficiencies. The first
method is far more difficult.  --Tony Hoare

More information about the dm-crypt mailing list