[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Auth](https://evolu.dev/docs/api-reference/common/local-first/Auth) › unwrapDeviceSecret

```ts
function unwrapDeviceSecret(
  wrapped: Uint8Array<ArrayBufferLike> &
    Brand<"Length72"> &
    Brand<"WrappedDeviceSecret">,
  key: Uint8Array<ArrayBufferLike> & Brand<"Entropy"> & Brand<"Length32">,
): Result<
  Uint8Array<ArrayBufferLike> &
    Brand<"Entropy"> &
    Brand<"Length32"> &
    Brand<"DeviceSecret">,
  DeviceSecretUnwrapError
>;
```

Defined in: [packages/common/src/local-first/Auth.ts:230](https://github.com/evoluhq/evolu/blob/aa223771feea747ffb1b0f5f3271574455633e37/packages/common/src/local-first/Auth.ts#L230)

Authenticates and unwraps a [WrappedDeviceSecret](https://evolu.dev/docs/api-reference/common/local-first/Auth/variables/WrappedDeviceSecret).