Giải mã sha256 nodejs

Mô-đun let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }0 cung cấp chức năng mã hóa bao gồm một bộ trình bao bọc cho hàm băm, HMAC, mật mã, giải mã, ký và xác minh của OpenSSL

Xác định xem có hỗ trợ tiền điện tử không

Nó có thể cho Node. js sẽ được xây dựng mà không bao gồm hỗ trợ cho mô-đun let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }0. Trong những trường hợp như vậy, cố gắng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }2 từ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }3 hoặc gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }4 sẽ dẫn đến lỗi bị ném

Khi sử dụng CommonJS, có thể bắt lỗi bằng cách sử dụng try/catch

let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }

Khi sử dụng từ khóa ESM let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }2 từ vựng, chỉ có thể phát hiện lỗi nếu trình xử lý cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }6 được đăng ký trước khi thực hiện bất kỳ nỗ lực tải mô-đun nào (ví dụ: sử dụng mô-đun tải trước)

Khi sử dụng ESM, nếu có khả năng mã có thể chạy trên bản dựng của Node. js khi hỗ trợ tiền điện tử không được bật, hãy cân nhắc sử dụng hàm let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }7 thay vì từ khóa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }2 từ vựng

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }9

SPKAC là cơ chế Yêu cầu ký chứng chỉ do Netscape triển khai ban đầu và được chỉ định chính thức như một phần của phần tử let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }20 của HTML5

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }21 không được dùng nữa kể từ HTML 5. 2 và các dự án mới không nên sử dụng phần tử này nữa

Mô-đun let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }0 cung cấp lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }9 để làm việc với dữ liệu SPKAC. Cách sử dụng phổ biến nhất là xử lý đầu ra được tạo bởi phần tử HTML5 let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }21. Nút. js sử dụng triển khai SPKAC của OpenSSL trong nội bộ

phương pháp tĩnh. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }25

Lịch sửPhiên bảnThay đổiv15. 0. 0

Đối số spkac có thể là một ArrayBuffer. Giới hạn kích thước của đối số spkac ở mức tối đa là 2**31 - 1 byte

v9. 0. 0

Đã thêm vào. v9. 0. 0

phương pháp tĩnh. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }26

Lịch sửPhiên bảnThay đổiv15. 0. 0

Đối số spkac có thể là một ArrayBuffer. Giới hạn kích thước của đối số spkac ở mức tối đa là 2**31 - 1 byte

v9. 0. 0

Đã thêm vào. v9. 0. 0

phương pháp tĩnh. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }27

Lịch sửPhiên bảnThay đổiv15. 0. 0

Đối số spkac có thể là một ArrayBuffer. Đã thêm mã hóa. Giới hạn kích thước của đối số spkac ở mức tối đa là 2**31 - 1 byte

v9. 0. 0

Đã thêm vào. v9. 0. 0

API kế thừa#

Là một giao diện kế thừa, có thể tạo các phiên bản mới của lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }28 như được minh họa trong các ví dụ bên dưới

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }29

Các thể hiện của lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }9 có thể được tạo bằng cách sử dụng từ khóa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 hoặc bằng cách gọi hàm let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }32

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }2let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }34let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }35

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36#

Các thể hiện của lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 được sử dụng để mã hóa dữ liệu. Lớp có thể được sử dụng theo một trong hai cách

  • Là một luồng vừa có thể đọc vừa có thể ghi, trong đó dữ liệu không được mã hóa đơn giản được ghi để tạo ra dữ liệu được mã hóa ở phía có thể đọc được hoặc
  • Sử dụng các phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39 để tạo dữ liệu được mã hóa

Các phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 được sử dụng để tạo các phiên bản let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36. Các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 không được tạo trực tiếp bằng từ khóa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31

Ví dụ. Sử dụng các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 làm luồng

Ví dụ. Sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 và luồng đường ống

Ví dụ. Sử dụng phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39#

  • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 Mã hóa giá trị trả về
  • trả lại. . Mọi nội dung được mã hóa còn lại. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được chỉ định, một chuỗi được trả về. Nếu một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 không được cung cấp, một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 sẽ được trả lại

Khi phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39 đã được gọi, đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 không còn có thể được sử dụng để mã hóa dữ liệu. Cố gắng gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39 nhiều lần sẽ dẫn đến lỗi bị ném

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37#

  • trả lại. Khi sử dụng chế độ mã hóa được xác thực (hiện đang hỗ trợ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 và let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31), phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37 trả về một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 chứa thẻ xác thực đã được tính toán từ dữ liệu đã cho

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37 chỉ nên được gọi sau khi quá trình mã hóa hoàn tất bằng phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39

Nếu tùy chọn let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 được đặt trong quá trình tạo phiên bản let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37, thì hàm này sẽ trả về chính xác byte let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36

let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39#

Khi sử dụng chế độ mã hóa được xác thực (hiện đang hỗ trợ ______438, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 và let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31), phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }74 đặt giá trị được sử dụng cho tham số đầu vào dữ liệu được xác thực bổ sung (AAD)

Tùy chọn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }75 là tùy chọn cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38 và let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30. Khi sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39, tùy chọn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }75 phải được chỉ định và giá trị của nó phải khớp với độ dài của văn bản gốc tính bằng byte. Xem chế độ CCM

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }74 phải được gọi trước let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }52#

Khi sử dụng thuật toán mã hóa khối, lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 sẽ tự động thêm phần đệm vào dữ liệu đầu vào để kích thước khối phù hợp. Để tắt phần đệm mặc định, hãy gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }54

Khi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }55 là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }56, độ dài của toàn bộ dữ liệu đầu vào phải là bội số của kích thước khối của mật mã, nếu không, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39 sẽ gây ra lỗi. Vô hiệu hóa phần đệm tự động rất hữu ích cho phần đệm không chuẩn, chẳng hạn như sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }58 thay vì phần đệm PKCS

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }59 phải được gọi trước let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }41

Lịch sửPhiên bảnChangesv6. 0. 0

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 mặc định đã thay đổi từ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

v0. 1. 94

Đã thêm vào. v0. 1. 94

Cập nhật mật mã với let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45. Nếu đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 được đưa ra, thì đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một chuỗi sử dụng mã hóa được chỉ định. Nếu đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 không được đưa ra, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 phải là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 sẽ bị bỏ qua

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 chỉ định định dạng đầu ra của dữ liệu được mã hóa. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được chỉ định, một chuỗi sử dụng mã hóa đã chỉ định sẽ được trả về. Nếu không có let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được cung cấp, một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 được trả về

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38 có thể được gọi nhiều lần với dữ liệu mới cho đến khi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39 được gọi. Gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38 sau let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39 sẽ dẫn đến lỗi bị ném

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16#

Các thể hiện của lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16 được sử dụng để giải mã dữ liệu. Lớp có thể được sử dụng theo một trong hai cách

  • Là một luồng vừa có thể đọc vừa có thể ghi, trong đó dữ liệu được mã hóa đơn giản được ghi để tạo ra dữ liệu không được mã hóa ở phía có thể đọc được hoặc
  • Sử dụng các phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }18 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19 để tạo dữ liệu không được mã hóa

Các phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }20 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }21 được sử dụng để tạo các phiên bản let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16. Các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16 không được tạo trực tiếp bằng từ khóa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31

Ví dụ. Sử dụng các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16 làm luồng

Ví dụ. Sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16 và luồng đường ống

Ví dụ. Sử dụng phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }18 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }29#

  • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 Mã hóa giá trị trả về
  • trả lại. . Mọi nội dung được giải mã còn lại. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được chỉ định, một chuỗi được trả về. Nếu một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 không được cung cấp, một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 sẽ được trả lại

Khi phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19 đã được gọi, đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16 không còn có thể được sử dụng để giải mã dữ liệu. Cố gắng gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19 nhiều lần sẽ dẫn đến lỗi bị ném

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37#

Lịch sửPhiên bảnThay đổiv15. 0. 0

Đối số bộ đệm có thể là một chuỗi hoặc ArrayBuffer và được giới hạn không quá 2 ** 31 - 1 byte

v7. 2. 0

Phương thức này bây giờ trả về một tham chiếu đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38

v1. 0. 0

Đã thêm vào. v1. 0. 0

Khi sử dụng chế độ mã hóa được xác thực (hiện đang hỗ trợ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 và let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31), phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 sẽ đặt giá trị được sử dụng cho tham số đầu vào dữ liệu được xác thực bổ sung (AAD)

Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 là tùy chọn cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38. Khi sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39, tùy chọn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }75 phải được chỉ định và giá trị của nó phải khớp với độ dài của bản mã tính bằng byte. Xem chế độ CCM

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 phải được gọi trước let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }18

Khi chuyển một chuỗi dưới dạng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50, vui lòng cân nhắc cẩn thận khi sử dụng chuỗi làm đầu vào cho API mật mã

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }51#

Lịch sửPhiên bảnThay đổiv15. 0. 0

Đối số bộ đệm có thể là một chuỗi hoặc ArrayBuffer và được giới hạn không quá 2 ** 31 - 1 byte

v11. 0. 0

Phương pháp này hiện ném nếu độ dài thẻ GCM không hợp lệ

v7. 2. 0

Phương thức này bây giờ trả về một tham chiếu đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38

v1. 0. 0

Đã thêm vào. v1. 0. 0

Khi sử dụng chế độ mã hóa được xác thực (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 và let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 hiện được hỗ trợ), phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }57 được sử dụng để chuyển thẻ xác thực đã nhận. Nếu không có thẻ nào được cung cấp hoặc nếu văn bản mật mã đã bị giả mạo, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19 sẽ ném ra, cho biết rằng văn bản mật mã sẽ bị loại bỏ do xác thực không thành công. Nếu độ dài thẻ không hợp lệ theo NIST SP 800-38D hoặc không khớp với giá trị của tùy chọn let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }57 sẽ đưa ra lỗi

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }57 phải được gọi trước let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }18 cho chế độ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }39 hoặc trước let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19 cho chế độ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }38 và let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 và let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }57 chỉ có thể được gọi một lần

Khi chuyển một chuỗi làm thẻ xác thực, vui lòng cân nhắc cẩn thận khi sử dụng các chuỗi làm đầu vào cho các API mật mã

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }69#

Khi dữ liệu đã được mã hóa mà không có phần đệm khối tiêu chuẩn, việc gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }70 sẽ vô hiệu hóa phần đệm tự động để ngăn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19 kiểm tra và xóa phần đệm

Tắt đệm tự động sẽ chỉ hoạt động nếu độ dài dữ liệu đầu vào là bội số của kích thước khối mật mã

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }72 phải được gọi trước let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }74

Lịch sửPhiên bảnChangesv6. 0. 0

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 mặc định đã thay đổi từ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

v0. 1. 94

Đã thêm vào. v0. 1. 94

Cập nhật bộ giải mã với let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45. Nếu đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 được đưa ra, thì đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một chuỗi sử dụng mã hóa được chỉ định. Nếu đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 không được đưa ra, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 phải là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 thì bỏ qua let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 chỉ định định dạng đầu ra của dữ liệu được mã hóa. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được chỉ định, một chuỗi sử dụng mã hóa đã chỉ định sẽ được trả về. Nếu không có let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được cung cấp, một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 được trả về

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }18 có thể được gọi nhiều lần với dữ liệu mới cho đến khi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19 được gọi. Gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }18 sau let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }19 sẽ dẫn đến lỗi bị ném

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }95#

Lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }95 là một tiện ích để tạo trao đổi khóa Diffie-Hellman

Có thể tạo các thể hiện của lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }95 bằng cách sử dụng hàm let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }98

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }99#

Tính toán bí mật dùng chung bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }200 làm khóa công khai của bên kia và trả về bí mật dùng chung đã tính toán. Khóa được cung cấp được giải thích bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 được chỉ định và bí mật được mã hóa bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được chỉ định. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 không được cung cấp, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }200 dự kiến ​​sẽ là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được đưa ra, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }210#

Tạo các giá trị khóa Diffie-Hellman riêng tư và công khai, đồng thời trả về khóa chung trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 đã chỉ định. Chìa khóa này nên được chuyển giao cho bên kia. Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }214#

Trả về trình tạo Diffie-Hellman trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 đã chỉ định. Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }218#

Trả về số nguyên tố Diffie-Hellman trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 đã chỉ định. Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }222#

Trả về khóa riêng Diffie-Hellman trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 đã chỉ định. Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }226#

Trả về khóa công khai Diffie-Hellman trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 đã chỉ định. Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }230#

Đặt khóa riêng Diffie-Hellman. Nếu đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 được cung cấp, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 sẽ là một chuỗi. Nếu không cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 dự kiến ​​sẽ là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }238#

Đặt khóa công khai Diffie-Hellman. Nếu đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 được cung cấp, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }240 sẽ là một chuỗi. Nếu không cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }240 dự kiến ​​sẽ là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }246#

Trường bit chứa bất kỳ cảnh báo và/hoặc lỗi nào do kiểm tra được thực hiện trong quá trình khởi tạo đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }95

Các giá trị sau hợp lệ cho thuộc tính này (như được định nghĩa trong mô-đun let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }248)

  • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }249
  • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }250
  • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }251
  • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }252

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }253#

Lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }253 lấy một nhóm modp nổi tiếng làm đối số của nó. Nó hoạt động giống như let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }95, ngoại trừ việc nó không cho phép thay đổi khóa sau khi tạo. Nói cách khác, nó không triển khai các phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }256 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }257

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }3

Các nhóm sau được hỗ trợ

Các nhóm sau vẫn được hỗ trợ nhưng không được dùng nữa (xem Lưu ý)

Các nhóm không dùng nữa này có thể bị xóa trong các phiên bản tương lai của Node. js

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }258#

Lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }258 là một tiện ích để tạo trao đổi khóa Elliptic Curve Diffie-Hellman (ECDH)

Có thể tạo các thể hiện của lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }258 bằng cách sử dụng hàm let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }261

phương pháp tĩnh. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }262#

Chuyển đổi khóa công khai EC Diffie-Hellman được chỉ định bởi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }264 sang định dạng được chỉ định bởi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265. Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 chỉ định mã hóa điểm và có thể là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }267, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }268 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }269. Khóa được cung cấp được diễn giải bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 đã chỉ định và khóa được trả về được mã hóa bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 đã chỉ định

Sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }272 để lấy danh sách tên đường cong có sẵn. Trên các bản phát hành OpenSSL gần đây, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }273 cũng sẽ hiển thị tên và mô tả của từng đường cong elip có sẵn

Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 không được chỉ định, điểm sẽ được trả về ở định dạng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }268

Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 không được cung cấp, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 dự kiến ​​sẽ là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

Ví dụ (giải nén key)

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }281#

Lịch sửPhiên bảnThay đổiv10. 0. 0

Đã thay đổi định dạng lỗi để hỗ trợ tốt hơn lỗi khóa công khai không hợp lệ

v6. 0. 0

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 mặc định đã thay đổi từ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

v0. 11. 14

Đã thêm vào. v0. 11. 14

Tính toán bí mật dùng chung bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }200 làm khóa công khai của bên kia và trả về bí mật dùng chung đã tính toán. Khóa được cung cấp được giải thích bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 được chỉ định và bí mật được trả về được mã hóa bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được chỉ định. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 không được cung cấp, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }200 dự kiến ​​sẽ là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 được đưa ra, một chuỗi sẽ được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }295 sẽ đưa ra lỗi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }296 khi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }200 nằm bên ngoài đường cong elip. Vì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }200 thường được cung cấp từ người dùng từ xa qua mạng không an toàn, hãy đảm bảo xử lý ngoại lệ này cho phù hợp

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }299#

Tạo các giá trị khóa EC Diffie-Hellman riêng và công khai, đồng thời trả về khóa chung trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 đã chỉ định. Chìa khóa này nên được chuyển giao cho bên kia

Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 chỉ định mã hóa điểm và có thể là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }267 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }268. Nếu không chỉ định let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265, điểm sẽ được trả về ở định dạng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }268

Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }309#

Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 được chỉ định, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }312#

Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 chỉ định mã hóa điểm và có thể là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }267 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }268. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 không được chỉ định, điểm sẽ được trả về ở định dạng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }268

Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 được chỉ định, một chuỗi được trả về;

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }320#

Đặt khóa riêng EC Diffie-Hellman. Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 sẽ là một chuỗi;

Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 không hợp lệ đối với đường cong được chỉ định khi đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }258 được tạo, thì sẽ xảy ra lỗi. Khi đặt khóa riêng, điểm công khai (khóa) được liên kết cũng được tạo và đặt trong đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }258

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330#

Đã thêm vào. v0. 11. 14Không dùng nữa kể từ đó. v5. 2. 0

Đặt khóa công khai EC Diffie-Hellman. Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }240 được mong đợi là một chuỗi;

Thông thường không có lý do gì để gọi phương thức này vì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }258 chỉ yêu cầu khóa riêng và khóa chung của bên kia để tính bí mật chung. Thông thường, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }337 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }338 sẽ được gọi. Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }338 cố gắng tạo điểm/khóa công khai được liên kết với khóa riêng đang được đặt

Ví dụ (có được một bí mật được chia sẻ)

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340#

Lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 là một tiện ích để tạo các bản tóm tắt dữ liệu băm. Nó có thể được sử dụng theo một trong hai cách

  • Là một luồng vừa có thể đọc vừa có thể ghi, trong đó dữ liệu được ghi để tạo ra một thông báo băm được tính toán ở phía có thể đọc được hoặc
  • Sử dụng các phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }342 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }343 để tạo hàm băm được tính toán

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }344 được sử dụng để tạo các thể hiện let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340. Các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 không được tạo trực tiếp bằng từ khóa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31

Ví dụ. Sử dụng các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 làm luồng

Ví dụ. Sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 và luồng đường ống

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }3

Ví dụ. Sử dụng phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }342 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }343

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }352#

Tạo một đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 mới chứa một bản sao sâu về trạng thái bên trong của đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 hiện tại

Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 tùy chọn kiểm soát hành vi của luồng. Đối với các hàm băm XOF chẳng hạn như let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }356, tùy chọn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }357 có thể được sử dụng để chỉ định độ dài đầu ra mong muốn tính bằng byte

Một lỗi được đưa ra khi cố gắng sao chép đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 sau khi phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }343 của nó đã được gọi

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }360#

Tính toán tóm tắt của tất cả dữ liệu được chuyển để được băm (sử dụng phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }342). Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, một chuỗi sẽ được trả về;

Không thể sử dụng lại đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 sau khi phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }343 đã được gọi. Nhiều cuộc gọi sẽ gây ra lỗi

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }366

Lịch sửPhiên bảnChangesv6. 0. 0

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 mặc định đã thay đổi từ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

v0. 1. 92

Đã thêm vào. v0. 1. 92

Cập nhật nội dung băm với let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 đã cho, mã hóa của nó được cung cấp trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 không được cung cấp và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một chuỗi, mã hóa của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 được thực thi. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 sẽ bị bỏ qua

Điều này có thể được gọi nhiều lần với dữ liệu mới khi nó được truyền phát

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380#

Lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 là một tiện ích để tạo các bản tóm tắt HMAC bằng mật mã. Nó có thể được sử dụng theo một trong hai cách

  • Là một luồng vừa có thể đọc vừa có thể ghi, trong đó dữ liệu được ghi để tạo ra thông báo HMAC được tính toán ở phía có thể đọc được hoặc
  • Sử dụng các phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }383 để tạo thông báo HMAC được tính toán

Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 được sử dụng để tạo các phiên bản let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380. Các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 không được tạo trực tiếp bằng từ khóa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31

Ví dụ. Sử dụng các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 làm luồng

Ví dụ. Sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 và luồng đường ống

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }3

Ví dụ. Sử dụng phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }383

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }392#

Tính toán thông báo HMAC của tất cả dữ liệu được truyền bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382. Nếu cung cấp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211, một chuỗi được trả về;

Không thể sử dụng lại đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 sau khi đã gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }383. Nhiều cuộc gọi đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }383 sẽ dẫn đến lỗi bị ném

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399

Lịch sửPhiên bảnChangesv6. 0. 0

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 mặc định đã thay đổi từ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

v0. 1. 94

Đã thêm vào. v0. 1. 94

Cập nhật nội dung let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 với let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 đã cho, mã hóa nội dung này được cung cấp trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 không được cung cấp và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một chuỗi, mã hóa của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 được thực thi. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 sẽ bị bỏ qua

Điều này có thể được gọi nhiều lần với dữ liệu mới khi nó được truyền phát

Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314#

Lịch sửPhiên bảnChangesv14. 5. 0, v12. 19. 0

Các phiên bản của lớp này giờ đây có thể được chuyển đến các luồng công nhân bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315

v11. 13. 0

Lớp này hiện đã được xuất

v11. 6. 0

Đã thêm vào. v11. 6. 0

Nút. js sử dụng lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 để biểu diễn khóa đối xứng hoặc bất đối xứng và mỗi loại khóa hiển thị các chức năng khác nhau. Các phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }317, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }318 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }319 được sử dụng để tạo các thể hiện let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314. Các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 không được tạo trực tiếp bằng từ khóa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31

Hầu hết các ứng dụng nên cân nhắc sử dụng API let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 mới thay vì chuyển khóa dưới dạng chuỗi hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 do các tính năng bảo mật được cải thiện

Phiên bản let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 có thể được chuyển đến các chủ đề khác thông qua let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }326. Người nhận nhận được một bản sao let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 không cần phải được liệt kê trong đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }329

phương pháp tĩnh. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330#

Ví dụ. Chuyển đổi phiên bản let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }331 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314

let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333#

Lịch sửPhiên bảnThay đổiv16. 9. 0

Đưa ra các tham số trình tự let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }334 cho các khóa RSA-PSS

v15. 7. 0

Đã thêm vào. v15. 7. 0

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }335. Kích thước khóa tính bằng bit (RSA, DSA)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }336. Số mũ công khai (RSA)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }337. Tên của thông báo tóm tắt (RSA-PSS)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }338. Tên của bản tóm tắt thông báo được sử dụng bởi MGF1 (RSA-PSS)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }339. Độ dài muối tối thiểu tính bằng byte (RSA-PSS)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340. Kích thước của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }341 tính bằng bit (DSA)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }342. Tên của đường cong (EC)

    Thuộc tính này chỉ tồn tại trên các khóa bất đối xứng. Tùy thuộc vào loại khóa, đối tượng này chứa thông tin về khóa. Không có thông tin nào thu được thông qua thuộc tính này có thể được sử dụng để xác định duy nhất một khóa hoặc để xâm phạm tính bảo mật của khóa

    Đối với khóa RSA-PSS, nếu tài liệu khóa chứa chuỗi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }334, các thuộc tính let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }337, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }338 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }339 sẽ được đặt

    Các chi tiết quan trọng khác có thể được hiển thị qua API này bằng cách sử dụng các thuộc tính bổ sung

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }347#

    Lịch sửPhiên bảnThay đổiv13. 9. 0, v12. 17. 0

    Đã thêm hỗ trợ cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }348

    v12. 0. 0

    Đã thêm hỗ trợ cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }349

    v12. 0. 0

    Thuộc tính này hiện trả về let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350 cho các trường hợp KeyObject thuộc loại không được nhận dạng thay vì hủy bỏ

    v12. 0. 0

    Đã thêm hỗ trợ cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }351 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }352

    v12. 0. 0

    Đã thêm hỗ trợ cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }353 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }354

    v11. 6. 0

    Đã thêm vào. v11. 6. 0

    Đối với các khóa bất đối xứng, thuộc tính này đại diện cho loại khóa. Các loại khóa được hỗ trợ là

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }355 (OID 1. 2. 840. 113549. 1. 1. 1)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }349 (OID 1. 2. 840. 113549. 1. 1. 10)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }357 (OID 1. 2. 840. 10040. 4. 1)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }358 (OID 1. 2. 840. 10045. 2. 1)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }351 (OID 1. 3. 101. 110)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }352 (OID 1. 3. 101. 111)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }353 (OID 1. 3. 101. 112)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }354 (OID 1. 3. 101. 113)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }348 (OID 1. 2. 840. 113549. 1. 3. 1)

    Thuộc tính này là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350 cho các loại let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 không được nhận dạng và khóa đối xứng

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }366#

    Lịch sửPhiên bảnThay đổiv15. 9. 0

    Đã thêm hỗ trợ cho định dạng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }367

    v11. 6. 0

    Đã thêm vào. v11. 6. 0

    Đối với các khóa đối xứng, có thể sử dụng các tùy chọn mã hóa sau

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265. Phải là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }369 (mặc định) hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }367

    Đối với khóa công khai, có thể sử dụng các tùy chọn mã hóa sau

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371. Phải là một trong số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }372 (chỉ RSA) hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }373
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265. Must be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }375, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }376, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }367

    Đối với khóa riêng, có thể sử dụng các tùy chọn mã hóa sau

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371. Must be one of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }372 (RSA only), let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }381 (EC only)
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265. Must be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }375, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }376, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }367
    • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37. If specified, the private key will be encrypted with the given let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }388 using PKCS#5 v2. 0 password based encryption
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }388. . The passphrase to use for encryption, see let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37

    The result type depends on the selected encoding format, when PEM the result is a string, when DER it will be a buffer containing the data encoded as DER, when JWK it will be an object

    When JWK encoding format was selected, all other encoding options are ignored

    PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 options. The PKCS#8 let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371 can be used with any let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 to encrypt any key algorithm (RSA, EC, or DH) by specifying a let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37. PKCS#1 and SEC1 can only be encrypted by specifying a let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }37 when the PEM let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 is used. For maximum compatibility, use PKCS#8 for encrypted private keys. Since PKCS#8 defines its own encryption mechanism, PEM-level encryption is not supported when encrypting a PKCS#8 key. See RFC 5208 for PKCS#8 encryption and RFC 1421 for PKCS#1 and SEC1 encryption

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }398#

    Added in. v17. 7. 0, v16. 15. 0

    Returns let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }56 depending on whether the keys have exactly the same type, value, and parameters. This method is not constant time

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }301#

    For secret keys, this property represents the size of the key in bytes. This property is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350 for asymmetric keys

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }303#

    Depending on the type of this let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, this property is either let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }305 for secret (symmetric) keys, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }306 for public (asymmetric) keys or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }307 for private (asymmetric) keys

    Class. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308#

    The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 class is a utility for generating signatures. It can be used in one of two ways

    The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }310 method is used to create let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 instances. The argument is the string name of the hash function to use. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 objects are not to be created directly using the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 keyword

    Example. Using let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315 objects as streams

    Example. Using the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }317 methods

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }318#

    Lịch sửPhiên bảnThay đổiv15. 0. 0

    The privateKey can also be an ArrayBuffer and CryptoKey

    v13. 2. 0, v12. 16. 0

    This function now supports IEEE-P1363 DSA and ECDSA signatures

    v12. 0. 0

    This function now supports RSA-PSS keys

    v11. 6. 0

    This function now supports key objects

    v8. 0. 0

    Support for RSASSA-PSS and additional options was added

    v0. 1. 92

    Đã thêm vào. v0. 1. 92

    Calculates the signature on all the data passed through using either let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }320

    If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 is not a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, this function behaves as if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 had been passed to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }319. If it is an object, the following additional properties can be passed

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 For DSA and ECDSA, this option specifies the format of the generated signature. It can be one of the following

      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }376 (default). DER-encoded ASN. 1 signature structure encoding let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }327
      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }328. Signature format let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }329 as proposed in IEEE-P1363
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330 Optional padding value for RSA, one of the following

      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }331 (default)
      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }332

      let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333 will use MGF1 with the same hash function used to sign the message as specified in section 3. 1 of RFC 4055, unless an MGF1 hash function has been specified as part of the key in compliance with section 3. 3 of RFC 4055

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }339 Salt length for when padding is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333. The special value let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }336 sets the salt length to the digest size, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }337 (default) sets it to the maximum permissible value

    If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 is provided a string is returned; otherwise a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 is returned

    The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 object can not be again used after let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }341 method has been called. Multiple calls to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }341 will result in an error being thrown

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }343

    Lịch sửPhiên bảnChangesv6. 0. 0

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 mặc định đã thay đổi từ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

    v0. 1. 92

    Đã thêm vào. v0. 1. 92

    Updates the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 content with the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45, the encoding of which is given in let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }211 không được cung cấp và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một chuỗi, mã hóa của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 được thực thi. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 sẽ bị bỏ qua

    Điều này có thể được gọi nhiều lần với dữ liệu mới khi nó được truyền phát

    Lớp. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315#

    Lớp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315 là một tiện ích để xác minh chữ ký. Nó có thể được sử dụng theo một trong hai cách

    Phương thức let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }360 được sử dụng để tạo các thể hiện let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315. Các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315 không được tạo trực tiếp bằng từ khóa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31

    Xem let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 để biết ví dụ

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }365

    Lịch sửPhiên bảnChangesv6. 0. 0

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 mặc định đã thay đổi từ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

    v0. 1. 92

    Đã thêm vào. v0. 1. 92

    Cập nhật nội dung let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315 với let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 đã cho, mã hóa nội dung này được cung cấp trong let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 không được cung cấp và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một chuỗi, mã hóa của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 được thực thi. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02, thì let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }42 sẽ bị bỏ qua

    Điều này có thể được gọi nhiều lần với dữ liệu mới khi nó được truyền phát

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380#

    Lịch sửPhiên bảnThay đổiv15. 0. 0

    Đối tượng cũng có thể là ArrayBuffer và CryptoKey

    v13. 2. 0, v12. 16. 0

    This function now supports IEEE-P1363 DSA and ECDSA signatures

    v12. 0. 0

    This function now supports RSA-PSS keys

    v11. 7. 0

    Khóa bây giờ có thể là khóa riêng

    v8. 0. 0

    Support for RSASSA-PSS and additional options was added

    v0. 1. 92

    Đã thêm vào. v0. 1. 92

    Xác minh dữ liệu được cung cấp bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }381 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382 đã cho

    Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }381 không phải là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, chức năng này hoạt động như thể let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }381 đã được chuyển đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }318. Nếu nó là một đối tượng, các thuộc tính bổ sung sau có thể được thông qua

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 Đối với DSA và ECDSA, tùy chọn này chỉ định định dạng của chữ ký. Nó có thể là một trong những điều sau đây

      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }376 (default). DER-encoded ASN. 1 signature structure encoding let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }327
      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }328. Signature format let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }329 as proposed in IEEE-P1363
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330 Optional padding value for RSA, one of the following

      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }331 (default)
      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }332

      let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333 sẽ sử dụng MGF1 với cùng hàm băm được sử dụng để xác minh thông báo như được chỉ định trong phần 3. 1 của RFC 4055, trừ khi hàm băm MGF1 đã được chỉ định như một phần của khóa tuân thủ mục 3. 3 của RFC 4055

    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }339 Chiều dài muối khi đệm là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333. Giá trị đặc biệt let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }336 đặt chiều dài muối thành kích thước tiêu hóa, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399 (mặc định) khiến nó được xác định tự động

    Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382 là chữ ký được tính toán trước đó cho dữ liệu, trong let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }301. If a let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }301 is specified, the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382 is expected to be a string; otherwise let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382 is expected to be a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

    Không thể sử dụng lại đối tượng let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 sau khi đã gọi let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }309. Multiple calls to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }309 will result in an error being thrown

    Vì khóa chung có thể được lấy từ khóa riêng nên khóa riêng có thể được chuyển thay vì khóa chung

    Lớp. let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }311

    Đóng gói chứng chỉ X509 và cung cấp quyền truy cập chỉ đọc vào thông tin của nó

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }3

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }312

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }313#

    • Type. Will be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399 if this is a Certificate Authority (CA) certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315#

    HistoryVersionChangesv18. 0. 0

    The subject option now defaults to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316

    v17. 5. 0, v16. 15. 0

    The subject option can now be set to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316

    v17. 5. 0, v16. 14. 1

    The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }318, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }319, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }320, and let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }321 options have been removed since they had no effect

    v15. 6. 0

    Added in. v15. 6. 0

    Checks whether the certificate matches the given email address

    If the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }322 option is undefined or set to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316, the certificate subject is only considered if the subject alternative name extension either does not exist or does not contain any email addresses

    If the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }322 option is set to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 and if the subject alternative name extension either does not exist or does not contain a matching email address, the certificate subject is considered

    If the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }322 option is set to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }327, the certificate subject is never considered, even if the certificate contains no subject alternative names

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }328#

    HistoryVersionChangesv18. 0. 0

    The subject option now defaults to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316

    v17. 5. 0, v16. 15. 0

    The subject option can now be set to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316

    v15. 6. 0

    Added in. v15. 6. 0

    Checks whether the certificate matches the given host name

    If the certificate matches the given host name, the matching subject name is returned. The returned name might be an exact match (e. g. , let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }331) or it might contain wildcards (e. g. , let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }332). Because host name comparisons are case-insensitive, the returned subject name might also differ from the given let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333 in capitalization

    If the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }322 option is undefined or set to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316, the certificate subject is only considered if the subject alternative name extension either does not exist or does not contain any DNS names. This behavior is consistent with RFC 2818 ("HTTP Over TLS")

    If the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }322 option is set to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 and if the subject alternative name extension either does not exist or does not contain a matching DNS name, the certificate subject is considered

    If the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }322 option is set to let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }327, the certificate subject is never considered, even if the certificate contains no subject alternative names

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340#

    HistoryVersionChangesv17. 5. 0, v16. 14. 1

    The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument has been removed since it had no effect

    v15. 6. 0

    Added in. v15. 6. 0

    Checks whether the certificate matches the given IP address (IPv4 or IPv6)

    Only RFC 5280 let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }342 subject alternative names are considered, and they must match the given let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }343 address exactly. Other subject alternative names as well as the subject field of the certificate are ignored

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }344#

    Checks whether this certificate was issued by the given let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }345

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }346#

    Checks whether the public key for this certificate is consistent with the given private key

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }347#

    The SHA-1 fingerprint of this certificate

    Because SHA-1 is cryptographically broken and because the security of SHA-1 is significantly worse than that of algorithms that are commonly used to sign certificates, consider using let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }348 instead

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }348#

    The SHA-256 fingerprint of this certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350#

    Added in. v17. 2. 0, v16. 14. 0

    The SHA-512 fingerprint of this certificate

    Because computing the SHA-256 fingerprint is usually faster and because it is only half the size of the SHA-512 fingerprint, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }348 may be a better choice. While SHA-512 presumably provides a higher level of security in general, the security of SHA-256 matches that of most algorithms that are commonly used to sign certificates

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }352#

    HistoryVersionChangesv17. 3. 1, v16. 13. 2

    Parts of this string may be encoded as JSON string literals in response to CVE-2021-44532

    v15. 6. 0

    Added in. v15. 6. 0

    A textual representation of the certificate's authority information access extension

    This is a line feed separated list of access descriptions. Each line begins with the access method and the kind of the access location, followed by a colon and the value associated with the access location

    After the prefix denoting the access method and the kind of the access location, the remainder of each line might be enclosed in quotes to indicate that the value is a JSON string literal. For backward compatibility, Node. js only uses JSON string literals within this property when necessary to avoid ambiguity. Third-party code should be prepared to handle both possible entry formats

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }353#

    The issuer identification included in this certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }354

    The issuer certificate or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350 if the issuer certificate is not available

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }356#

    An array detailing the key usages for this certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }357#

    The public key for this certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }358#

    A let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 containing the DER encoding of this certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }360#

    The serial number of this certificate

    Serial numbers are assigned by certificate authorities and do not uniquely identify certificates. Consider using let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }348 as a unique identifier instead

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }362#

    The complete subject of this certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }363#

    HistoryVersionChangesv17. 3. 1, v16. 13. 2

    Parts of this string may be encoded as JSON string literals in response to CVE-2021-44532

    v15. 6. 0

    Added in. v15. 6. 0

    The subject alternative name specified for this certificate

    This is a comma-separated list of subject alternative names. Each entry begins with a string identifying the kind of the subject alternative name followed by a colon and the value associated with the entry

    Earlier versions of Node. js incorrectly assumed that it is safe to split this property at the two-character sequence let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }364 (see CVE-2021-44532). However, both malicious and legitimate certificates can contain subject alternative names that include this sequence when represented as a string

    After the prefix denoting the type of the entry, the remainder of each entry might be enclosed in quotes to indicate that the value is a JSON string literal. For backward compatibility, Node. js only uses JSON string literals within this property when necessary to avoid ambiguity. Third-party code should be prepared to handle both possible entry formats

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }365#

    There is no standard JSON encoding for X509 certificates. The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }366 method returns a string containing the PEM encoded certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }367#

    Returns information about this certificate using the legacy certificate object encoding

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }368#

    Returns the PEM-encoded certificate

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }369#

    The date/time from which this certificate is considered valid

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }370#

    The date/time until which this certificate is considered valid

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371#

    Verifies that this certificate was signed by the given public key. Does not perform any other validation checks on the certificate

    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }0 phương thức và thuộc tính mô-đun#

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }373#

    An object containing commonly used constants for crypto and security related operations. The specific constants currently defined are described in Crypto constants

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374#

    Added in. v0. 9. 3Deprecated since. v10. 0. 0

    The default encoding to use for functions that can take either strings or buffers. The default value is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }369, which makes methods default to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 objects

    The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 mechanism is provided for backward compatibility with legacy programs that expect let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }378 to be the default encoding

    New applications should expect the default to be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }369

    This property is deprecated

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380#

    Added in. v6. 0. 0Deprecated since. v10. 0. 0

    Property for checking and controlling whether a FIPS compliant crypto provider is currently in use. Setting to true requires a FIPS build of Node. js

    This property is deprecated. Please use let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }381 and let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382 instead

    let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }383#

    HistoryVersionChangesv18. 0. 0

    Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

    v15. 8. 0

    Added in. v15. 8. 0

    • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }387 . . . . . A possible prime encoded as a sequence of big endian octets of arbitrary length
    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44
      • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }389 The number of Miller-Rabin probabilistic primality iterations to perform. When the value is let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }390 (zero), a number of checks is used that yields a false positive rate of at most 2-64 for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }391 function let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }392 options for more details. Default. let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }390
    • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384
      • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 Set to an object if an error occurred during check
      • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }396 let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399 if the candidate is a prime with an error probability less than let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }398
    • Checks the primality of the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }387

      let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }700#

      • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }387 . . . . . A possible prime encoded as a sequence of big endian octets of arbitrary length
      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44
        • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }389 The number of Miller-Rabin probabilistic primality iterations to perform. When the value is let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }390 (zero), a number of checks is used that yields a false positive rate of at most 2-64 for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }391 function let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }392 options for more details. Default. let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }390
      • Returns. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399 if the candidate is a prime with an error probability less than let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }398
      • Checks the primality of the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }387

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }711#

        HistoryVersionChangesv17. 9. 0, v16. 17. 0

        The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is now optional when using the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 cipher and defaults to 16 bytes

        v15. 0. 0

        The password argument can be an ArrayBuffer and is limited to a maximum of 2 ** 31 - 1 bytes

        v10. 10. 0

        Ciphers in OCB mode are now supported

        v10. 2. 0

        The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option can now be used to produce shorter authentication tags in GCM mode and defaults to 16 bytes

        v10. 0. 0

        Deprecated since. v10. 0. 0

        v0. 1. 94

        Đã thêm vào. v0. 1. 94

        Creates and returns a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 object that uses the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument controls stream behavior and is optional except when a cipher in CCM or OCB mode (e. g. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }719) is used. In that case, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is required and specifies the length of the authentication tag in bytes, see CCM mode. In GCM mode, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is not required but can be used to set the length of the authentication tag that will be returned by let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }722 and defaults to 16 bytes. For let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option defaults to 16 bytes

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 is dependent on OpenSSL, examples are let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }726, etc. On recent OpenSSL releases, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }727 will display the available cipher algorithms

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717 is used to derive the cipher key and initialization vector (IV). The value must be either a let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }378 encoded string, a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01, or a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

        This function is semantically insecure for all supported ciphers and fatally flawed for ciphers in counter mode (such as CTR, GCM, or CCM)

        The implementation of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30 derives keys using the OpenSSL function let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }734 with the digest algorithm set to MD5, one iteration, and no salt. The lack of salt allows dictionary attacks as the same password always creates the same key. The low iteration count and non-cryptographically secure hash algorithm allow passwords to be tested very rapidly

        In line with OpenSSL's recommendation to use a more modern algorithm instead of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }734 it is recommended that developers derive a key and IV on their own using let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }736 and to use let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 to create the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 object. Users should not use ciphers with counter mode (e. g. CTR, GCM, or CCM) in let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }30. A warning is emitted when they are used in order to avoid the risk of IV reuse that causes vulnerabilities. For the case when IV is reused in GCM, see Nonce-Disrespecting Adversaries for details

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }740#

        HistoryVersionChangesv17. 9. 0, v16. 17. 0

        The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is now optional when using the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 cipher and defaults to 16 bytes

        v15. 0. 0

        The password and iv arguments can be an ArrayBuffer and are each limited to a maximum of 2 ** 31 - 1 bytes

        v11. 6. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 argument can now be a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314

        v11. 2. 0, v10. 17. 0

        The cipher let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 (the IETF variant of ChaCha20-Poly1305) is now supported

        v10. 10. 0

        Ciphers in OCB mode are now supported

        v10. 2. 0

        The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option can now be used to produce shorter authentication tags in GCM mode and defaults to 16 bytes

        v9. 9. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747 parameter may now be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748 for ciphers which do not need an initialization vector

        v0. 1. 94

        Đã thêm vào. v0. 1. 94

        Creates and returns a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 object, with the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 and initialization vector (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747)

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument controls stream behavior and is optional except when a cipher in CCM or OCB mode (e. g. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }719) is used. In that case, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is required and specifies the length of the authentication tag in bytes, see CCM mode. In GCM mode, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is not required but can be used to set the length of the authentication tag that will be returned by let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }722 and defaults to 16 bytes. For let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option defaults to 16 bytes

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 is dependent on OpenSSL, examples are let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }726, etc. On recent OpenSSL releases, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }727 will display the available cipher algorithms

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 is the raw key used by the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747 is an initialization vector. Both arguments must be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 encoded strings, Buffers, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02s. The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 may optionally be a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 of type let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }771. If the cipher does not need an initialization vector, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747 may be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748

        When passing strings for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747, please consider caveats when using strings as inputs to cryptographic APIs

        Initialization vectors should be unpredictable and unique; ideally, they will be cryptographically random. They do not have to be secret. IVs are typically just added to ciphertext messages unencrypted. It may sound contradictory that something has to be unpredictable and unique, but does not have to be secret; remember that an attacker must not be able to predict ahead of time what a given IV will be

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }776#

        HistoryVersionChangesv17. 9. 0, v16. 17. 0

        The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is now optional when using the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 cipher and defaults to 16 bytes

        v10. 10. 0

        Ciphers in OCB mode are now supported

        v10. 0. 0

        Deprecated since. v10. 0. 0

        v0. 1. 94

        Đã thêm vào. v0. 1. 94

        Creates and returns a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16 object that uses the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717 (key)

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument controls stream behavior and is optional except when a cipher in CCM or OCB mode (e. g. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }719) được sử dụng. In that case, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is required and specifies the length of the authentication tag in bytes, see CCM mode. For let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option defaults to 16 bytes

        This function is semantically insecure for all supported ciphers and fatally flawed for ciphers in counter mode (such as CTR, GCM, or CCM)

        The implementation of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }20 derives keys using the OpenSSL function let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }734 with the digest algorithm set to MD5, one iteration, and no salt. The lack of salt allows dictionary attacks as the same password always creates the same key. The low iteration count and non-cryptographically secure hash algorithm allow passwords to be tested very rapidly

        In line with OpenSSL's recommendation to use a more modern algorithm instead of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }734 it is recommended that developers derive a key and IV on their own using let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }736 and to use let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }21 to create the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16 object

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }793#

        HistoryVersionChangesv17. 9. 0, v16. 17. 0

        The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is now optional when using the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 cipher and defaults to 16 bytes

        v11. 6. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 argument can now be a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314

        v11. 2. 0, v10. 17. 0

        The cipher let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31 (the IETF variant of ChaCha20-Poly1305) is now supported

        v10. 10. 0

        Ciphers in OCB mode are now supported

        v10. 2. 0

        The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option can now be used to restrict accepted GCM authentication tag lengths

        v9. 9. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747 parameter may now be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748 for ciphers which do not need an initialization vector

        v0. 1. 94

        Đã thêm vào. v0. 1. 94

        Creates and returns a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }16 object that uses the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 and initialization vector (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747)

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument controls stream behavior and is optional except when a cipher in CCM or OCB mode (e. g. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }719) is used. In that case, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is required and specifies the length of the authentication tag in bytes, see CCM mode. In GCM mode, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option is not required but can be used to restrict accepted authentication tags to those with the specified length. For let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }31, the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 option defaults to 16 bytes

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 is dependent on OpenSSL, examples are let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }726, etc. On recent OpenSSL releases, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }727 will display the available cipher algorithms

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 is the raw key used by the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747 is an initialization vector. Both arguments must be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 encoded strings, Buffers, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02s. The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 may optionally be a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 of type let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }771. If the cipher does not need an initialization vector, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747 may be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748

        When passing strings for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }747, please consider caveats when using strings as inputs to cryptographic APIs

        Initialization vectors should be unpredictable and unique; ideally, they will be cryptographically random. They do not have to be secret. IVs are typically just added to ciphertext messages unencrypted. It may sound contradictory that something has to be unpredictable and unique, but does not have to be secret; remember that an attacker must not be able to predict ahead of time what a given IV will be

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }528#

        HistoryVersionChangesv8. 0. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }529 argument can be any let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 now

        v8. 0. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }529 argument can be a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }533 now

        v6. 0. 0

        The default for the encoding parameters changed from let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

        v0. 11. 12

        Added in. v0. 11. 12

        Creates a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }95 key exchange object using the supplied let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }529 and an optional specific let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }538

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }538 argument can be a number, string, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33. If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }538 is not specified, the value let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }542 is used

        If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }543 is specified, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }529 is expected to be a string; otherwise a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 is expected

        If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }548 is specified, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }538 is expected to be a string; otherwise a number, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 is expected

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }553#

        Creates a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }95 key exchange object and generates a prime of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }555 bits using an optional specific numeric let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }538. If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }538 is not specified, the value let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }542 is used

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }559#

        An alias for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }560

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }561#

        Creates an Elliptic Curve Diffie-Hellman (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }258) key exchange object using a predefined curve specified by the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }563 string. Use let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }272 to obtain a list of available curve names. On recent OpenSSL releases, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }273 will also display the name and description of each available elliptic curve

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }566#

        HistoryVersionChangesv12. 8. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }357 option was added for XOF hash functions

        v0. 1. 92

        Đã thêm vào. v0. 1. 92

        Creates and returns a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }340 object that can be used to generate hash digests using the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716. Optional let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument controls stream behavior. For XOF hash functions such as let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }356, the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }357 option can be used to specify the desired output length in bytes

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }574, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }575, etc. On recent releases of OpenSSL, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }576 will display the available digest algorithms

        Example. generating the sha256 sum of a file

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }577#

        Lịch sửPhiên bảnThay đổiv15. 0. 0

        The key can also be an ArrayBuffer or CryptoKey. The encoding option was added. Khóa không thể chứa nhiều hơn 2 ** 32 - 1 byte

        v11. 6. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 argument can now be a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314

        v0. 1. 94

        Đã thêm vào. v0. 1. 94

        Creates and returns an let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 object that uses the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263. Optional let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument controls stream behavior

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }574, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }575, etc. On recent releases of OpenSSL, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }576 will display the available digest algorithms

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 is the HMAC key used to generate the cryptographic HMAC hash. If it is a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, its type must be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }771

        Example. generating the sha256 HMAC of a file

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }591#

        HistoryVersionChangesv15. 12. 0

        The key can also be a JWK object

        v15. 0. 0

        The key can also be an ArrayBuffer. The encoding option was added. The key cannot contain more than 2 ** 32 - 1 bytes

        v11. 6. 0

        Đã thêm vào. v11. 6. 0

        Creates and returns a new key object containing a private key. If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 is a string or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 is assumed to be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }375; otherwise, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 must be an object with the properties described above

        If the private key is encrypted, a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }388 must be specified. The length of the passphrase is limited to 1024 bytes

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }598#

        HistoryVersionChangesv15. 12. 0

        The key can also be a JWK object

        v15. 0. 0

        The key can also be an ArrayBuffer. The encoding option was added. The key cannot contain more than 2 ** 32 - 1 bytes

        v11. 13. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 argument can now be a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 with type let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }401

        v11. 7. 0

        The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 argument can now be a private key

        v11. 6. 0

        Đã thêm vào. v11. 6. 0

        Creates and returns a new key object containing a public key. If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 is a string or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }265 is assumed to be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }375; if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 is a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 with type let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }307, the public key is derived from the given private key; otherwise, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 must be an object with the properties described above

        If the format is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }375, the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }412 may also be an X. 509 certificate

        Because public keys can be derived from private keys, a private key may be passed instead of a public key. In that case, this function behaves as if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }319 had been called, except that the type of the returned let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 will be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }306 and that the private key cannot be extracted from the returned let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314. Similarly, if a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 with type let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }307 is given, a new let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314 with type let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }306 will be returned and it will be impossible to extract the private key from the returned object

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }421#

        HistoryVersionChangesv18. 8. 0, v16. 18. 0

        The key can now be zero-length

        v15. 0. 0

        The key can also be an ArrayBuffer or string. The encoding argument was added. The key cannot contain more than 2 ** 32 - 1 bytes

        v11. 6. 0

        Đã thêm vào. v11. 6. 0

        Creates and returns a new key object containing a secret key for symmetric encryption or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }423#

        Creates and returns a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 object that uses the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716. Use let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }426 to obtain the names of the available digest algorithms. Optional let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument controls the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }428 behavior

        In some cases, a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }308 instance can be created using the name of a signature algorithm, such as let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }430, instead of a digest algorithm. This will use the corresponding digest algorithm. This does not work for all signature algorithms, such as let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }431, so it is best to always use digest algorithm names

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }432#

        Creates and returns a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315 object that uses the given algorithm. Use let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }426 to obtain an array of names of the available signing algorithms. Optional let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44 argument controls the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }428 behavior

        In some cases, a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315 instance can be created using the name of a signature algorithm, such as let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }430, instead of a digest algorithm. Điều này sẽ sử dụng thuật toán phân loại tương ứng. This does not work for all signature algorithms, such as let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }431, so it is best to always use digest algorithm names

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }440#

        Added in. v13. 9. 0, v12. 17. 0

        Computes the Diffie-Hellman secret based on a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 and a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }240. Both keys must have the same let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }443, which must be one of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }348 (for Diffie-Hellman), let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }358 (for ECDH), let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }352, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }351 (for ECDH-ES)

        let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }448#

        HistoryVersionChangesv18. 0. 0

        Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

        v15. 0. 0

        Added in. v15. 0. 0

        • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371. The intended use of the generated secret key. Currently accepted values are let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }453 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }454
        • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44.
          • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }456. The bit length of the key to generate. This must be a value greater than 0
            • If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371 is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }453, the minimum is 8, and the maximum length is 231-1. If the value is not a multiple of 8, the generated key will be truncated to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }459
            • If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371 is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }454, the length must be one of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }462, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }463, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }464
        • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384.
        • Asynchronously generates a new random secret key of the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }456. The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371 will determine which validations will be performed on the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }456

          let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }469#

          HistoryVersionChangesv18. 0. 0

          Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

          v16. 10. 0

          Add ability to define let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }334 sequence parameters for RSA-PSS keys pairs

          v13. 9. 0, v12. 17. 0

          Add support for Diffie-Hellman

          v12. 0. 0

          Add support for RSA-PSS key pairs

          v12. 0. 0

          Thêm khả năng tạo cặp khóa X25519 và X448

          v12. 0. 0

          Add ability to generate Ed25519 and Ed448 key pairs

          v11. 6. 0

          The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }474 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }475 functions now produce key objects if no encoding was specified

          v10. 12. 0

          Added in. v10. 12. 0

          Generates a new asymmetric key pair of the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371. RSA, RSA-PSS, DSA, EC, Ed25519, Ed448, X25519, X448, and DH are currently supported

          If a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }477 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }478 was specified, this function behaves as if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }479 had been called on its result. Otherwise, the respective part of the key is returned as a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314

          It is recommended to encode public keys as let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }373 and private keys as let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 with encryption for long-term storage

          On completion, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 will be called with let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 set to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }240 / let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 representing the generated key pair

          If this method is invoked as its let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }488ed version, it returns a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }489 for an let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }490 with let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }240 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 properties

          let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }493#

          HistoryVersionChangesv16. 10. 0

          Add ability to define let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }334 sequence parameters for RSA-PSS keys pairs

          v13. 9. 0, v12. 17. 0

          Add support for Diffie-Hellman

          v12. 0. 0

          Add support for RSA-PSS key pairs

          v12. 0. 0

          Thêm khả năng tạo cặp khóa X25519 và X448

          v12. 0. 0

          Add ability to generate Ed25519 and Ed448 key pairs

          v11. 6. 0

          The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }474 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }475 functions now produce key objects if no encoding was specified

          v10. 12. 0

          Added in. v10. 12. 0

          • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371. Must be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }355, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }349, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }357, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }358, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }353, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }354, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }351, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }352, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }348
          • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44.
          • Returns.

            Generates a new asymmetric key pair of the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371. RSA, RSA-PSS, DSA, EC, Ed25519, Ed448, X25519, X448, and DH are currently supported

            If a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }477 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }478 was specified, this function behaves as if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }479 had been called on its result. Otherwise, the respective part of the key is returned as a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314

            When encoding public keys, it is recommended to use let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }373. When encoding private keys, it is recommended to use let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }380 with a strong passphrase, and to keep the passphrase confidential

            let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }7

            The return value let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }015 represents the generated key pair. When PEM encoding was selected, the respective key will be a string, otherwise it will be a buffer containing the data encoded as DER

            let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }016#

            • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371. The intended use of the generated secret key. Currently accepted values are let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }453 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }454
            • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44.
              • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }456. The bit length of the key to generate
                • If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371 is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }453, the minimum is 8, and the maximum length is 231-1. If the value is not a multiple of 8, the generated key will be truncated to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }459
                • If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371 is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }454, the length must be one of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }462, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }463, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }464
            • Returns.
            • Synchronously generates a new random secret key of the given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }456. The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371 will determine which validations will be performed on the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }456

              let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }033#

              HistoryVersionChangesv18. 0. 0

              Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

              v15. 8. 0

              Added in. v15. 8. 0

              Generates a pseudorandom prime of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }037 bits

              If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }038 is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399, the prime will be a safe prime -- that is, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }040 will also be a prime

              The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }042 parameters can be used to enforce additional requirements, e. g. , for Diffie-Hellman

              • If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }042 are both set, the prime will satisfy the condition that let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }045
              • If only let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 is set and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }038 is not let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399, the prime will satisfy the condition that let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }049
              • If only let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 is set and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }038 is set to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399, the prime will instead satisfy the condition that let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }053. This is necessary because let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }049 for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }055 would contradict the condition enforced by let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }038
              • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }042 is ignored if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 is not given

              Both let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }042 must be encoded as big-endian sequences if given as an let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }061, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }062, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

              By default, the prime is encoded as a big-endian sequence of octets in an . If the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }066 option is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399, then a is provided

              let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }068#

              Generates a pseudorandom prime of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }037 bits

              If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }038 is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399, the prime will be a safe prime -- that is, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }040 will also be a prime

              The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }042 parameters can be used to enforce additional requirements, e. g. , for Diffie-Hellman

              • If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }042 are both set, the prime will satisfy the condition that let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }045
              • If only let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 is set and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }038 is not let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399, the prime will satisfy the condition that let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }049
              • If only let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 is set and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }038 is set to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399, the prime will instead satisfy the condition that let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }053. This is necessary because let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }049 for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }055 would contradict the condition enforced by let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }038
              • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }042 is ignored if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 is not given

              Both let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }041 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }042 must be encoded as big-endian sequences if given as an let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }061, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }062, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02

              By default, the prime is encoded as a big-endian sequence of octets in an . If the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }066 option is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399, then a is provided

              let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }100#

              • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }101. . The name or nid of the cipher to query
              • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44.
              • Returns.
                • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333 The name of the cipher
                • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }104 The nid of the cipher
                • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }105 The block size of the cipher in bytes. This property is omitted when let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }106 is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }107
                • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }108 The expected or default initialization vector length in bytes. This property is omitted if the cipher does not use an initialization vector
                • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }109 The expected or default key length in bytes
                • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }106 The cipher mode. One of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }111, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }112, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }113, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }114, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }115, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }116, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }117, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }118, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }107, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }120, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }121

                Returns information about a given cipher

                Some ciphers accept variable length keys and initialization vectors. By default, the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }122 method will return the default values for these ciphers. To test if a given key length or iv length is acceptable for given cipher, use the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }109 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }108 options. If the given values are unacceptable, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350 will be returned

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }126#

                • Returns. An array with the names of the supported cipher algorithms

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }272#

                • Returns. An array with the names of the supported elliptic curves

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }128#

                Creates a predefined let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }253 key exchange object. The supported groups are listed in the documentation for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }253

                The returned object mimics the interface of objects created by let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }98, but will not allow changing the keys (with let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }132, for example). The advantage of using this method is that the parties do not have to generate nor exchange a group modulus beforehand, saving both processor and communication time

                Ví dụ (có được một bí mật được chia sẻ)

                let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382#

                • Returns. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }134 if and only if a FIPS compliant crypto provider is currently in use, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }390 otherwise. Bản phát hành chính trong học kỳ trong tương lai có thể thay đổi loại trả về của API này thành

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }426#

                • Returns. An array of the names of the supported hash algorithms, such as let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }430. Thuật toán băm còn được gọi là thuật toán "tiêu hóa"

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }138#

                Một bí danh thuận tiện cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }139. Việc triển khai này không tuân thủ thông số Web Crypto, để viết mã tương thích với web, hãy sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }139 thay thế

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }141#

                HistoryVersionChangesv18. 0. 0

                Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                v18. 8. 0, v16. 18. 0

                The input keying material can now be zero-length

                v15. 0. 0

                Added in. v15. 0. 0

                HKDF is a simple key derivation function defined in RFC 5869. The given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }145, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }147 are used with the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }148 to derive a key of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }149 bytes

                The supplied let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 function is called with two arguments. let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152. If an errors occurs while deriving the key, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 will be set; otherwise let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 will be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748. The successfully generated let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152 will be passed to the callback as an . An error will be thrown if any of the input arguments specify invalid values or types

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }157#

                HistoryVersionChangesv18. 8. 0, v16. 18. 0

                The input keying material can now be zero-length

                v15. 0. 0

                Added in. v15. 0. 0

                Provides a synchronous HKDF key derivation function as defined in RFC 5869. The given let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }145, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }147 are used with the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }148 to derive a key of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }149 bytes

                The successfully generated let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152 will be returned as an

                An error will be thrown if any of the input arguments specify invalid values or types, or if the derived key cannot be generated

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }164#

                HistoryVersionChangesv18. 0. 0

                Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                v15. 0. 0

                The password and salt arguments can also be ArrayBuffer instances

                v14. 0. 0

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }168 parameter is now restricted to positive values. Earlier releases treated other values as one

                v8. 0. 0

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }148 parameter is always required now

                v6. 0. 0

                Calling this function without passing the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }148 parameter is deprecated now and will emit a warning

                v6. 0. 0

                The default encoding for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717 if it is a string changed from let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

                v0. 5. 5

                Added in. v0. 5. 5

                Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) implementation. A selected HMAC digest algorithm specified by let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }148 is applied to derive a key of the requested byte length (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }149) from the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }168

                The supplied let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 function is called with two arguments. let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152. If an error occurs while deriving the key, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 will be set; otherwise let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 will be let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748. By default, the successfully generated let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152 will be passed to the callback as a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33. An error will be thrown if any of the input arguments specify invalid values or types

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }168 argument must be a number set as high as possible. The higher the number of iterations, the more secure the derived key will be, but will take a longer amount of time to complete

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146 should be as unique as possible. It is recommended that a salt is random and at least 16 bytes long. See NIST SP 800-132 for details

                When passing strings for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146, please consider caveats when using strings as inputs to cryptographic APIs

                The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 property can be used to change the way the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152 is passed to the callback. This property, however, has been deprecated and use should be avoided

                Có thể truy xuất một mảng các hàm thông báo được hỗ trợ bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }426

                This API uses libuv's threadpool, which can have surprising and negative performance implications for some applications; see the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }194 documentation for more information

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }195#

                HistoryVersionChangesv14. 0. 0

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }168 parameter is now restricted to positive values. Earlier releases treated other values as one

                v6. 0. 0

                Calling this function without passing the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }148 parameter is deprecated now and will emit a warning

                v6. 0. 0

                The default encoding for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717 if it is a string changed from let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }43 to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44

                v0. 9. 3

                Added in. v0. 9. 3

                Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) implementation. A selected HMAC digest algorithm specified by let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }148 is applied to derive a key of the requested byte length (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }149) from the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146 and let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }168

                If an error occurs an let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }206 will be thrown, otherwise the derived key will be returned as a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }168 argument must be a number set as high as possible. The higher the number of iterations, the more secure the derived key will be, but will take a longer amount of time to complete

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146 should be as unique as possible. It is recommended that a salt is random and at least 16 bytes long. See NIST SP 800-132 for details

                When passing strings for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146, please consider caveats when using strings as inputs to cryptographic APIs

                The let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374 property may be used to change the way the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152 is returned. This property, however, is deprecated and use should be avoided

                Có thể truy xuất một mảng các hàm thông báo được hỗ trợ bằng cách sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }426

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }215#

                Lịch sửPhiên bảnThay đổiv15. 0. 0

                Added string, ArrayBuffer, and CryptoKey as allowable key types. The oaepLabel can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes

                v12. 11. 0

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }216 option was added

                v12. 9. 0

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }217 option was added

                v11. 6. 0

                This function now supports key objects

                v0. 11. 14

                Đã thêm vào. v0. 11. 14

                Decrypts let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50 with let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50 was previously encrypted using the corresponding public key, for example using let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }221

                If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 is not a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, this function behaves as if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 had been passed to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }319. If it is an object, the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330 property can be passed. Otherwise, this function uses let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }227

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }228#

                Lịch sửPhiên bảnThay đổiv15. 0. 0

                Added string, ArrayBuffer, and CryptoKey as allowable key types. The passphrase can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes

                v11. 6. 0

                This function now supports key objects

                v1. 1. 0

                Added in. v1. 1. 0

                Encrypts let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50 with let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232. The returned data can be decrypted using the corresponding public key, for example using let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }231

                If let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 is not a let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, this function behaves as if let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }232 had been passed to let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }319. If it is an object, the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330 property can be passed. Otherwise, this function uses let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }237

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }238#

                Lịch sửPhiên bảnThay đổiv15. 0. 0

                Added string, ArrayBuffer, and CryptoKey as allowable key types. The passphrase can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes

                v11. 6. 0

                This function now supports key objects

                v1. 1. 0

                Added in. v1. 1. 0

                Decrypts let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50 with let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50 was previously encrypted using the corresponding private key, for example using let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }242

                Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 không phải là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, chức năng này hoạt động như thể let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 đã được chuyển đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }318. If it is an object, the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330 property can be passed. Otherwise, this function uses let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }237

                Because RSA public keys can be derived from private keys, a private key may be passed instead of a public key

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }249#

                Lịch sửPhiên bảnThay đổiv15. 0. 0

                Added string, ArrayBuffer, and CryptoKey as allowable key types. The oaepLabel and passphrase can be ArrayBuffers. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes

                v12. 11. 0

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }216 option was added

                v12. 9. 0

                The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }217 option was added

                v11. 6. 0

                This function now supports key objects

                v0. 11. 14

                Đã thêm vào. v0. 11. 14

                Encrypts the content of let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50 with let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 and returns a new let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 with encrypted content. Dữ liệu được trả về có thể được giải mã bằng khóa riêng tư tương ứng, ví dụ: sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }255

                Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 không phải là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, chức năng này hoạt động như thể let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 đã được chuyển đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }318. Nếu nó là một đối tượng, thuộc tính let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330 có thể được chuyển. Mặt khác, chức năng này sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }227

                Because RSA public keys can be derived from private keys, a private key may be passed instead of a public key

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }262#

                HistoryVersionChangesv18. 0. 0

                Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                v9. 0. 0

                Vượt qua let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748 khi đối số let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 hiện ném let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                v0. 5. 8

                Đã thêm vào. v0. 5. 8

                • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }037 Số byte cần tạo. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }037 không được lớn hơn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }271
                • let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384
                • trả lại. nếu chức năng let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 không được cung cấp

                Tạo dữ liệu giả ngẫu nhiên mạnh bằng mật mã. Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }037 là một số cho biết số lượng byte cần tạo

                Nếu một hàm let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 được cung cấp, các byte được tạo không đồng bộ và hàm let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 được gọi với hai đối số. let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }278. Nếu xảy ra lỗi, let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 sẽ là một đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }206; . Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }278 là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 chứa các byte được tạo

                Nếu chức năng let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 không được cung cấp, các byte ngẫu nhiên được tạo đồng bộ và được trả về dưới dạng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33. Sẽ xảy ra lỗi nếu có sự cố khi tạo byte

                Phương pháp let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }286 sẽ không hoàn thành cho đến khi có đủ entropy. Điều này thường không bao giờ mất nhiều thời gian hơn một vài mili giây. Thời điểm duy nhất khi tạo các byte ngẫu nhiên có thể bị chặn trong một khoảng thời gian dài hơn là ngay sau khi khởi động, khi toàn bộ hệ thống vẫn còn ở mức entropy thấp

                This API uses libuv's threadpool, which can have surprising and negative performance implications for some applications; see the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }194 documentation for more information

                Phiên bản không đồng bộ của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }286 được thực hiện trong một yêu cầu nhóm luồng duy nhất. Để giảm thiểu sự thay đổi về độ dài của tác vụ nhóm luồng, hãy phân vùng các yêu cầu lớn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }289 khi thực hiện việc này như một phần của việc đáp ứng yêu cầu của khách hàng

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }290#

                Lịch sửPhiên bảnChangesv9. 0. 0

                Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50 có thể là bất kỳ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 nào

                v7. 10. 0, v6. 13. 0

                Đã thêm vào. v7. 10. 0, v6. 13. 0

                Phiên bản đồng bộ của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }294

                Bất kỳ phiên bản let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }061, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 nào cũng có thể được chuyển thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }5

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }299#

                HistoryVersionChangesv18. 0. 0

                Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                v9. 0. 0

                Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50 có thể là bất kỳ let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 nào

                v7. 10. 0, v6. 13. 0

                Đã thêm vào. v7. 10. 0, v6. 13. 0

                Chức năng này tương tự như let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }286 nhưng yêu cầu đối số đầu tiên là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 sẽ được điền. Nó cũng yêu cầu một cuộc gọi lại được chuyển vào

                Nếu chức năng let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 không được cung cấp, sẽ xảy ra lỗi

                Bất kỳ phiên bản let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }061, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 nào cũng có thể được chuyển thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }50

                Mặc dù điều này bao gồm các trường hợp của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }313 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, chức năng này không nên được sử dụng để tạo các số dấu phẩy động ngẫu nhiên. Kết quả có thể chứa let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }315, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }316 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }317 và ngay cả khi mảng chỉ chứa các số hữu hạn, chúng không được rút ra từ phân phối ngẫu nhiên đồng nhất và không có giới hạn trên hoặc dưới có ý nghĩa

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }4

                This API uses libuv's threadpool, which can have surprising and negative performance implications for some applications; see the let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }194 documentation for more information

                Phiên bản không đồng bộ của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }294 được thực hiện trong một yêu cầu nhóm luồng duy nhất. Để giảm thiểu sự thay đổi độ dài của tác vụ threadpool, hãy phân vùng các yêu cầu lớn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }320 khi thực hiện như một phần của việc đáp ứng yêu cầu của khách hàng

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }321#

                HistoryVersionChangesv18. 0. 0

                Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                v14. 10. 0, v12. 19. 0

                Đã thêm vào. v14. 10. 0, v12. 19. 0

                Trả về một số nguyên ngẫu nhiên let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 sao cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }326. Việc thực hiện này tránh sai lệch modulo

                Phạm vi (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }327) phải nhỏ hơn 248. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }328 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }329 phải là số nguyên an toàn

                Nếu chức năng let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 không được cung cấp, số nguyên ngẫu nhiên được tạo đồng bộ

                let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }331#

                Đã thêm vào. v15. 6. 0, v14. 17. 0

                • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }44
                  • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333 Theo mặc định, để cải thiện hiệu suất, Nút. js tạo và lưu trữ đủ dữ liệu ngẫu nhiên để tạo tối đa 128 UUID ngẫu nhiên. Để tạo UUID mà không sử dụng bộ đệm, hãy đặt let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333 thành let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }399. Mặc định. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }56
                • Returns.
                • Tạo UUID RFC 4122 phiên bản 4 ngẫu nhiên. UUID được tạo bằng trình tạo số giả ngẫu nhiên mã hóa

                  let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }337#

                  HistoryVersionChangesv18. 0. 0

                  Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                  v15. 0. 0

                  The password and salt arguments can also be ArrayBuffer instances

                  v12. 8. 0, v10. 17. 0

                  Giá trị let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }341 bây giờ có thể là bất kỳ số nguyên an toàn nào

                  v10. 9. 0

                  Tên tùy chọn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }342, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }105 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }344 đã được thêm vào

                  v10. 5. 0

                  Đã thêm vào. v10. 5. 0

                  Cung cấp triển khai scrypt không đồng bộ. Scrypt là một chức năng dẫn xuất khóa dựa trên mật khẩu được thiết kế tốn kém về mặt tính toán và bộ nhớ để làm cho các cuộc tấn công vũ phu trở nên vô ích

                  The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146 should be as unique as possible. It is recommended that a salt is random and at least 16 bytes long. See NIST SP 800-132 for details

                  When passing strings for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146, please consider caveats when using strings as inputs to cryptographic APIs

                  Hàm let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 được gọi với hai đối số. let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152. let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 là một đối tượng ngoại lệ khi dẫn xuất khóa không thành công, nếu không thì let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }395 là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }152 được chuyển đến cuộc gọi lại dưới dạng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33

                  Một ngoại lệ được đưa ra khi bất kỳ đối số đầu vào nào chỉ định các giá trị hoặc loại không hợp lệ

                  let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }356#

                  Lịch sửPhiên bảnChangesv12. 8. 0, v10. 17. 0

                  Giá trị let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }341 bây giờ có thể là bất kỳ số nguyên an toàn nào

                  v10. 9. 0

                  Tên tùy chọn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }342, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }105 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }344 đã được thêm vào

                  v10. 5. 0

                  Đã thêm vào. v10. 5. 0

                  Cung cấp triển khai scrypt đồng bộ. Scrypt là một chức năng dẫn xuất khóa dựa trên mật khẩu được thiết kế tốn kém về mặt tính toán và bộ nhớ để làm cho các cuộc tấn công vũ phu trở nên vô ích

                  The let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146 should be as unique as possible. It is recommended that a salt is random and at least 16 bytes long. See NIST SP 800-132 for details

                  When passing strings for let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }717 or let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }146, please consider caveats when using strings as inputs to cryptographic APIs

                  Một ngoại lệ được đưa ra khi dẫn xuất khóa không thành công, nếu không, khóa dẫn xuất được trả về dưới dạng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33

                  Một ngoại lệ được đưa ra khi bất kỳ đối số đầu vào nào chỉ định các giá trị hoặc loại không hợp lệ

                  let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }365#

                  • Returns.
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }366 Tổng kích thước heap an toàn được phân bổ như được chỉ định bằng cách sử dụng cờ dòng lệnh let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }367
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }328 Phân bổ tối thiểu từ đống bảo mật như được chỉ định bằng cách sử dụng cờ dòng lệnh let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }369
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }370 Tổng số byte hiện được phân bổ từ vùng bảo mật
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }371 Tỷ lệ tính toán của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }370 đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }366 byte được phân bổ

                    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }374#

                    Tải và đặt let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }375 cho một số hoặc tất cả các chức năng OpenSSL (được chọn theo cờ)

                    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }375 có thể là id hoặc đường dẫn đến thư viện dùng chung của công cụ

                    Đối số tùy chọn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }377 sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }378 theo mặc định. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }377 là một trường bit nhận một trong hoặc kết hợp các cờ sau (được định nghĩa trong let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }373)

                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }381
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }383
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }387
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }388
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }389
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }390
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }391

                    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }392#

                    Cho phép nhà cung cấp tiền điện tử tuân thủ FIPS trong Nút hỗ trợ FIPS. xây dựng js. Ném lỗi nếu chế độ FIPS không khả dụng

                    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }393#

                    HistoryVersionChangesv18. 0. 0

                    Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                    v15. 12. 0

                    Đã thêm đối số gọi lại tùy chọn

                    v13. 2. 0, v12. 16. 0

                    This function now supports IEEE-P1363 DSA and ECDSA signatures

                    v12. 0. 0

                    Đã thêm vào. v12. 0. 0

                    Tính toán và trả về chữ ký cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 bằng thuật toán và khóa riêng đã cho. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350, thì thuật toán phụ thuộc vào loại khóa (đặc biệt là Ed25519 và Ed448)

                    Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 không phải là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, chức năng này hoạt động như thể let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 đã được chuyển đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }319. Nếu nó là một đối tượng, các thuộc tính bổ sung sau có thể được thông qua

                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 For DSA and ECDSA, this option specifies the format of the generated signature. It can be one of the following

                      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }376 (default). DER-encoded ASN. 1 signature structure encoding let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }327
                      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }328. Signature format let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }329 as proposed in IEEE-P1363
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330 Optional padding value for RSA, one of the following

                      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }331 (default)
                      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }332

                      let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333 sẽ sử dụng MGF1 với cùng hàm băm được sử dụng để ký thông báo như đã chỉ định trong phần 3. 1 của RFC 4055

                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }339 Salt length for when padding is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333. The special value let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }336 sets the salt length to the digest size, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }337 (default) sets it to the maximum permissible value

                    Nếu hàm let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 được cung cấp thì hàm này sử dụng nhóm luồng của libuv

                    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }419#

                    Một bí danh thuận tiện cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }420

                    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }421#

                    Lịch sửPhiên bảnThay đổiv15. 0. 0

                    Các đối số a và b cũng có thể là ArrayBuffer

                    v6. 6. 0

                    Đã thêm vào. v6. 6. 0

                    Hàm này so sánh các byte bên dưới đại diện cho các phiên bản let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }061, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 đã cho bằng cách sử dụng thuật toán thời gian không đổi

                    Chức năng này không rò rỉ thông tin thời gian cho phép kẻ tấn công đoán một trong các giá trị. Điều này phù hợp để so sánh các bản tóm tắt HMAC hoặc các giá trị bí mật như cookie xác thực hoặc url khả năng

                    Cả let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }425 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }426 đều phải là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }02 và chúng phải có cùng độ dài byte. Sẽ xảy ra lỗi nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }425 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }426 có độ dài byte khác nhau

                    Nếu ít nhất một trong số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }425 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }426 là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }01 với nhiều hơn một byte cho mỗi mục nhập, chẳng hạn như let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }435, thì kết quả sẽ được tính bằng cách sử dụng thứ tự byte nền tảng

                    Khi cả hai đầu vào đều là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }313 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, hàm này có thể trả về kết quả không mong muốn do mã hóa IEEE 754 của số dấu phẩy động. Cụ thể, cả let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }438 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }439 đều không ngụ ý rằng biểu diễn byte của hai số dấu phẩy động let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }440 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }441 là bằng nhau

                    Việc sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }442 không đảm bảo rằng mã xung quanh an toàn về thời gian. Cần cẩn thận để đảm bảo rằng mã xung quanh không đưa ra các lỗ hổng thời gian

                    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }443#

                    HistoryVersionChangesv18. 0. 0

                    Passing an invalid callback to the let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 argument now throws let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }385 instead of let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }386

                    v15. 12. 0

                    Đã thêm đối số gọi lại tùy chọn

                    v15. 0. 0

                    Các đối số dữ liệu, khóa và chữ ký cũng có thể là ArrayBuffer

                    v13. 2. 0, v12. 16. 0

                    This function now supports IEEE-P1363 DSA and ECDSA signatures

                    v12. 0. 0

                    Đã thêm vào. v12. 0. 0

                    Xác minh chữ ký đã cho cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45 bằng khóa và thuật toán đã cho. Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }716 là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }748 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }350, thì thuật toán phụ thuộc vào loại khóa (đặc biệt là Ed25519 và Ed448)

                    Nếu let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 không phải là một let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }314, chức năng này hoạt động như thể let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263 đã được chuyển đến let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }318. Nếu nó là một đối tượng, các thuộc tính bổ sung sau có thể được thông qua

                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 Đối với DSA và ECDSA, tùy chọn này chỉ định định dạng của chữ ký. Nó có thể là một trong những điều sau đây

                      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }376 (default). DER-encoded ASN. 1 signature structure encoding let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }327
                      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }328. Signature format let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }329 as proposed in IEEE-P1363
                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }330 Optional padding value for RSA, one of the following

                      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }331 (default)
                      • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }332

                      let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333 sẽ sử dụng MGF1 với cùng hàm băm được sử dụng để ký thông báo như đã chỉ định trong phần 3. 1 của RFC 4055

                    • let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }339 Salt length for when padding is let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }333. The special value let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }336 sets the salt length to the digest size, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }337 (default) sets it to the maximum permissible value

                    Đối số let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }382 là chữ ký được tính toán trước đó cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }45

                    Vì khóa chung có thể được lấy từ khóa riêng nên khóa riêng hoặc khóa chung có thể được chuyển cho let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }263

                    Nếu hàm let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }384 được cung cấp thì hàm này sử dụng nhóm luồng của libuv

                    let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }472#

                    Loại. Triển khai tiêu chuẩn Web Crypto API

                    Xem tài liệu Web Crypto API để biết chi tiết

                    Ghi chú #

                    Sử dụng chuỗi làm đầu vào cho API mã hóa#

                    Vì những lý do lịch sử, nhiều API mật mã do Node cung cấp. js chấp nhận các chuỗi làm đầu vào trong đó thuật toán mã hóa cơ bản hoạt động trên các chuỗi byte. Những trường hợp này bao gồm bản rõ, bản mã, khóa đối xứng, vectơ khởi tạo, cụm mật khẩu, muối, thẻ xác thực và dữ liệu được xác thực bổ sung

                    Khi chuyển chuỗi tới API mật mã, hãy xem xét các yếu tố sau

                    • Không phải tất cả các chuỗi byte đều là chuỗi UTF-8 hợp lệ. Do đó, khi một chuỗi byte có độ dài let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 được lấy từ một chuỗi, entropy của nó thường thấp hơn entropy của chuỗi byte let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }325 ngẫu nhiên hoặc giả ngẫu nhiên. Ví dụ: không có chuỗi UTF-8 nào sẽ dẫn đến chuỗi byte let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }475. Các khóa bí mật hầu như chỉ là các chuỗi byte ngẫu nhiên hoặc giả ngẫu nhiên

                    • Tương tự, khi chuyển đổi các chuỗi byte ngẫu nhiên hoặc giả ngẫu nhiên thành chuỗi UTF-8, các chuỗi con không đại diện cho các điểm mã hợp lệ có thể được thay thế bằng ký tự thay thế Unicode (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }476). Do đó, biểu diễn byte của chuỗi Unicode kết quả có thể không bằng chuỗi byte mà chuỗi được tạo từ đó

                      Đầu ra của mật mã, hàm băm, thuật toán chữ ký và hàm dẫn xuất khóa là các chuỗi byte giả ngẫu nhiên và không được sử dụng làm chuỗi Unicode

                    • Khi các chuỗi được lấy từ đầu vào của người dùng, một số ký tự Unicode có thể được biểu diễn theo nhiều cách tương đương dẫn đến các chuỗi byte khác nhau. Ví dụ: khi chuyển cụm mật khẩu người dùng tới hàm dẫn xuất khóa, chẳng hạn như PBKDF2 hoặc scrypt, kết quả của hàm dẫn xuất khóa phụ thuộc vào việc chuỗi sử dụng các ký tự tổng hợp hay ký tự phân tách. Nút. js không chuẩn hóa biểu diễn ký tự. Các nhà phát triển nên cân nhắc sử dụng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }477 đối với đầu vào của người dùng trước khi chuyển chúng tới các API mật mã

                    API luồng kế thừa (trước Node. js 0. 10) #

                    Mô-đun Crypto đã được thêm vào Node. js trước khi có khái niệm về API luồng hợp nhất và trước khi có đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 để xử lý dữ liệu nhị phân. Như vậy, nhiều lớp được định nghĩa bởi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }3 có các phương thức thường không được tìm thấy trên các Nút khác. js triển khai API luồng (e. g. let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }480, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }481, hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }482). Ngoài ra, nhiều phương thức được chấp nhận và trả về các chuỗi mã hóa let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }378 theo mặc định thay vì các chuỗi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33. Mặc định này đã được thay đổi sau khi Node. js v0. 8 để sử dụng các đối tượng let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }33 theo mặc định

                    Hỗ trợ cho các thuật toán yếu hoặc bị xâm nhập#

                    Mô-đun let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }0 vẫn hỗ trợ một số thuật toán đã bị xâm phạm và hiện không được khuyến nghị sử dụng. API cũng cho phép sử dụng mật mã và hàm băm với kích thước khóa nhỏ quá yếu để sử dụng an toàn

                    Người dùng phải chịu hoàn toàn trách nhiệm trong việc lựa chọn thuật toán mật mã và kích thước khóa theo yêu cầu bảo mật của họ

                    Dựa trên các khuyến nghị của NIST SP 800-131A

                    • MD5 và SHA-1 không còn được chấp nhận khi cần có khả năng chống va chạm, chẳng hạn như chữ ký số
                    • Khóa được sử dụng với thuật toán RSA, DSA và DH nên có ít nhất 2048 bit và đường cong của ECDSA và ECDH ít nhất là 224 bit, để có thể sử dụng an toàn trong vài năm
                    • Các nhóm DH của let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }487, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }488 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }489 có kích thước khóa nhỏ hơn 2048 bit và không được khuyến nghị

                    Xem tài liệu tham khảo để biết các khuyến nghị và chi tiết khác

                    Một số thuật toán đã biết điểm yếu và ít liên quan trong thực tế chỉ khả dụng thông qua nhà cung cấp kế thừa, không được bật theo mặc định

                    Chế độ CCM #

                    CCM là một trong những thuật toán AEAD được hỗ trợ. Các ứng dụng sử dụng chế độ này phải tuân thủ một số hạn chế nhất định khi sử dụng API mật mã

                    • Độ dài thẻ xác thực phải được chỉ định trong quá trình tạo mật mã bằng cách đặt tùy chọn let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }36 và phải là một trong 4, 6, 8, 10, 12, 14 hoặc 16 byte
                    • Độ dài của vectơ khởi tạo (nonce) let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }491 phải nằm trong khoảng từ 7 đến 13 byte (let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }492)
                    • Độ dài của bản rõ được giới hạn ở let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }493 byte
                    • Khi giải mã, thẻ xác thực phải được đặt qua let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }494 trước khi gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }480. Nếu không, quá trình giải mã sẽ không thành công và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }481 sẽ đưa ra lỗi tuân thủ phần 2. 6 của RFC 3610
                    • Việc sử dụng các phương thức truyền phát như let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }497, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }498 hoặc let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }499 trong chế độ CCM có thể không thành công vì CCM không thể xử lý nhiều hơn một đoạn dữ liệu cho mỗi phiên bản
                    • Khi truyền dữ liệu được xác thực bổ sung (AAD), độ dài của tin nhắn thực tế tính bằng byte phải được truyền tới let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }500 thông qua tùy chọn let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }75. Nhiều thư viện mật mã bao gồm thẻ xác thực trong bản mã, có nghĩa là chúng tạo ra bản mã có độ dài let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }502. Nút. js không bao gồm thẻ xác thực, vì vậy độ dài bản mã luôn là let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }75. Điều này là không cần thiết nếu không sử dụng AAD
                    • Vì CCM xử lý toàn bộ thông báo cùng một lúc, nên phải gọi chính xác một lần let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }480
                    • Mặc dù gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }480 là đủ để mã hóa/giải mã tin nhắn, nhưng các ứng dụng phải gọi let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }481 để tính toán hoặc xác minh thẻ xác thực

                    Hằng số tiền điện tử#

                    Các hằng số sau được xuất bởi let crypto; try { crypto = require('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }373 áp dụng cho các mục đích sử dụng khác nhau của các mô-đun let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }0, let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }509 và let crypto; try { crypto = await import('node:crypto'); } catch (err) { console.error('crypto support is disabled!'); }510 và thường dành riêng cho OpenSSL

Chủ đề