# Backup HSM2 without setting DKEK

**URL:** https://support.nitrokey.com/t/backup-hsm2-without-setting-dkek/5659
**Category:** HSM
**Created:** [November 30, 2023, 8:36am UTC](https://support.nitrokey.com/t/backup-hsm2-without-setting-dkek/5659 "2023-11-30T08:36:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Cynthia\_Hsu](https://support.nitrokey.com/user_avatar/support.nitrokey.com/cynthia_hsu/32/1584_2.png) [@Cynthia\_Hsu](https://support.nitrokey.com/u/Cynthia_Hsu)
#### Post date: [November 30, 2023, 8:36am UTC](https://support.nitrokey.com/t/backup-hsm2-without-setting-dkek/5659/1 "2023-11-30T08:36:54Z")

</div>

I didn’t set DKEK before initialization. Are there any other ways to back up HSM2? I saw the below article in “[Raymii.org](http://Raymii.org)”. The DKEK must be set during initialization and before any other keys are generated. For a device initialized without a DKEK, keys can never be exported.

---

<div class="post-metadata">

### Author: ![nku](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@nku](https://support.nitrokey.com/u/nku)
#### Post date: [November 30, 2023, 8:47am UTC](https://support.nitrokey.com/t/backup-hsm2-without-setting-dkek/5659/2 "2023-11-30T08:47:20Z")

</div>

A random DKEK is generated if you did not create your own. This means you can create backups but only import it to the same device as long it has not been reset (as a new DKEK would be generated).

You could protect against user error like deleting a key but not against hardware error and you cannot import it into another HSM.

---

<div class="post-metadata">

### Author: ![sc-hsm](https://support.nitrokey.com/user_avatar/support.nitrokey.com/sc-hsm/32/304_2.png) [@sc-hsm](https://support.nitrokey.com/u/sc-hsm)
#### Post date: [November 30, 2023, 12:57pm UTC](https://support.nitrokey.com/t/backup-hsm2-without-setting-dkek/5659/3 "2023-11-30T12:57:16Z")

</div>

There is also a backup feature called XKEK Key Domains.

A SmartCard-HSM that is part of a XKEK Key Domain can exchange key material in encrypted form. Rather than using a static DKEK, the XKEK is the result of an authenticated ECDH operation between two devices. Devices authenticate each other and ensure that they belong to the same key domain. A key domain is controlled by an EC key called the group signer. As the name implies, the group signer issues Key Domain Membership certificates that allow a device to join the key domain.

That scheme is fairly sophisticated and not really meant for the end-user. It is rather something one would implement in systems that require tight control over key distribution (Like encryption key escrow or shared keys in clusters).

A HowTo for XKEK Key Domains can be found in the [CDN](https://cdn.cardcontact.de/attachments/107).
