ricmoo / aes-js

A pure JavaScript implementation of the AES block cipher and all common modes of operation for node.js or web browsers.
MIT License
1.45k stars 272 forks source link

Feature Request: Import key from hex #96

Closed Caleb-Irwin closed 2 years ago

Caleb-Irwin commented 4 years ago

This would be more elegant and simple to implement then importing keys from a array of decimal (Base 10) bytes. If there is a way to do this with the existing code it would be good if it was documented better.

webdevelopland commented 2 years ago
function getKeyFromHex(hex: string): Uint8Array {
  return AES.utils.hex.toBytes(hex);
}