[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] passphase is not correct when cryptsetup open a luks
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-discuss] passphase is not correct when cryptsetup open a luks image created by qemu-img |
Date: |
Tue, 16 Aug 2016 10:59:56 +0100 |
User-agent: |
Mutt/1.6.2 (2016-07-01) |
On Tue, Aug 16, 2016 at 05:48:37AM -0400, Han Han wrote:
> Hi all,
> I created a luks image via qemu-img and tried to open it via cryptsetup but
> failed.
> I did following steps:
> # qemu-img create -f luks --object
> secret,id=sec0,data=c3RhdGUxMjMK,format=base64 -o key-secret=sec0 /tmp/qemu
> 500M
> Formatting '/tmp/qemu', fmt=luks size=524288000 key-secret=sec0
>
> # cryptsetup luksOpen /tmp/qemu ss
>
>
> Enter passphrase for /tmp/qemu:
> No key available with this passphrase.
> Enter passphrase for /tmp/qemu:
> No key available with this passphrase.
>
> Both the encoded password c3RhdGUxMjMK and decoded password state123 are not
> correct. So how can I open the luks image via cryptsetup? Is there anything
> wrong in above steps?
You've made a mistake in base64 encoding - you've encoded the newline
character. You should do this to avoid the newline:
$ echo -n state123 | base64
c3RhdGUxMjM=
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|