@secrecy/lib 1.86.4-fix-md5.1 → 1.86.4-fix-crypto.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/client/SecrecyCloudClient.js +6 -5
- package/dist/lib/client/data-link.js +11 -6
- package/dist/lib/client/helpers.js +15 -1
- package/dist/lib/client/upload.js +9 -9
- package/dist/lib/crypto/data.js +7 -4
- package/dist/lib/crypto/domain.js +3 -1
- package/dist/lib/crypto/helpers.js +10 -2
- package/dist/lib/crypto/index.js +9 -2
- package/dist/lib/versioning.js +1 -1
- package/dist/lib/worker/generated/sodium.js +1 -1
- package/dist/lib/worker/sodium.js +4 -3
- package/dist/types/client/data-link.d.ts +4 -4
- package/dist/types/client/helpers.d.ts +1 -0
- package/dist/types/client/types/data.d.ts +1 -2
- package/dist/types/client.d.ts +74 -66
- package/dist/types/crypto/data.d.ts +13 -3
- package/dist/types/crypto/domain.d.ts +1 -0
- package/dist/types/crypto/helpers.d.ts +6 -2
- package/dist/types/crypto/index.d.ts +9 -3
- package/dist/types/sodium.d.ts +0 -5
- package/dist/types/versioning.d.ts +1 -1
- package/dist/types/worker/generated/sodium.d.ts +1 -1
- package/dist/types/worker/sodium.d.ts +2 -2
- package/package.json +7 -6
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
export interface EncryptedFile {
|
|
2
2
|
data: Uint8Array<ArrayBuffer>;
|
|
3
|
-
|
|
3
|
+
md5: string;
|
|
4
4
|
md5Encrypted: string;
|
|
5
5
|
}
|
|
6
|
+
export interface DecryptSecretStreamOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Accept a stream whose last chunk is not tagged `TAG_FINAL`.
|
|
9
|
+
* Streams produced before the final tag was always set (size multiple of
|
|
10
|
+
* CHUNK_SIZE) lack it, so a truncation at a chunk boundary is undetectable
|
|
11
|
+
* for them: only enable this when the caller verifies the decrypted content
|
|
12
|
+
* independently (e.g. against a known digest).
|
|
13
|
+
*/
|
|
14
|
+
allowMissingFinalTag?: boolean;
|
|
15
|
+
}
|
|
6
16
|
export declare function secretStreamKeygen(): Uint8Array;
|
|
7
17
|
export declare const CHUNK_SIZE = 8192;
|
|
8
18
|
export interface SecretStreamProgress {
|
|
@@ -19,6 +29,6 @@ export declare function encryptSecretStream(key: Uint8Array, data: Uint8Array<Ar
|
|
|
19
29
|
/**
|
|
20
30
|
* Decrypt a secretstream produced by `encryptSecretStream`. Throws if any
|
|
21
31
|
* chunk fails authentication, if data follows the `TAG_FINAL` chunk, or if the
|
|
22
|
-
* stream ends without it (truncation).
|
|
32
|
+
* stream ends without it (truncation) unless `allowMissingFinalTag` is set.
|
|
23
33
|
*/
|
|
24
|
-
export declare function decryptSecretStream(key: Uint8Array, data: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>, signal?: AbortSignal): Promise<Uint8Array<ArrayBuffer>>;
|
|
34
|
+
export declare function decryptSecretStream(key: Uint8Array, data: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>, signal?: AbortSignal, options?: DecryptSecretStreamOptions): Promise<Uint8Array<ArrayBuffer>>;
|
|
@@ -19,6 +19,7 @@ export declare function encryptDataAndKey({ data, currentIdentity, keyPairs, pro
|
|
|
19
19
|
encryptedDataKey?: Uint8Array<ArrayBufferLike>;
|
|
20
20
|
encryptedData: Uint8Array<ArrayBuffer>;
|
|
21
21
|
dataKey: Uint8Array<ArrayBufferLike>;
|
|
22
|
+
md5Data: string;
|
|
22
23
|
md5Encrypted: string;
|
|
23
24
|
}>;
|
|
24
25
|
export declare function buildBytesFromApiData({ dataContent, totalBytes, progressParts, onDownloadProgress, signal, }: {
|
|
@@ -5,8 +5,12 @@ export declare function derivePassword(password: string, salt: Uint8Array<ArrayB
|
|
|
5
5
|
* `version (1 byte) || salt || nonce || secretbox(key)`.
|
|
6
6
|
*/
|
|
7
7
|
export declare function encryptKeyWithPassword(key: Uint8Array, password: string): Uint8Array;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Unwrap a data key produced by `encryptKeyWithPassword`. Also reads the
|
|
10
|
+
* legacy format (`nonce || secretbox(key)`) whose salt was derived from the
|
|
11
|
+
* password and the plaintext md5, hence `legacyMd5`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function decryptKeyWithPassword(wrapped: Uint8Array, password: string, legacyMd5: string): Uint8Array;
|
|
10
14
|
export declare function encryptName(name: string, nameKey: string): Promise<string>;
|
|
11
15
|
export declare function generateAndEncryptNameAndKey(args: {
|
|
12
16
|
name: string;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { type StringKeyPair } from '../sodium.js';
|
|
2
1
|
export declare function encryptCryptoBox(data: Uint8Array, publicKeyBob: string, privateKeyAlice: string): Uint8Array;
|
|
3
|
-
export declare function generateCryptoBoxKeyPair():
|
|
2
|
+
export declare function generateCryptoBoxKeyPair(): {
|
|
3
|
+
publicKey: string;
|
|
4
|
+
privateKey: string;
|
|
5
|
+
keyType: string;
|
|
6
|
+
};
|
|
4
7
|
export declare function decryptCryptoBox(data: Uint8Array, publicKeyAlice: string, privateKeyBob: string): Uint8Array;
|
|
5
8
|
export declare function generateSecretBoxKey(): string;
|
|
6
9
|
export declare function encryptSecretBox(data: Uint8Array, key: string): Uint8Array;
|
|
7
10
|
export declare function decryptSecretBox(data: Uint8Array, key: string): Uint8Array;
|
|
8
11
|
export declare function encryptAnonymous(data: Uint8Array, receiverPublicKey: string): Uint8Array;
|
|
9
|
-
export declare function decryptAnonymous(data: Uint8Array, { privateKey, publicKey }:
|
|
12
|
+
export declare function decryptAnonymous(data: Uint8Array, { privateKey, publicKey }: {
|
|
13
|
+
privateKey: string;
|
|
14
|
+
publicKey: string;
|
|
15
|
+
}): Uint8Array;
|
package/dist/types/sodium.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SECRECY_LIB_VERSION = "
|
|
1
|
+
export declare const SECRECY_LIB_VERSION = "1.86.4-fix-crypto.1";
|