Skip to content

Commit

Permalink
remove hex check
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Oct 24, 2024
1 parent c135ba9 commit 20e9523
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/secrets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ import { z } from "zod";
class AES256EncryptionService {
private algorithm = "aes-256-cbc";

constructor(private key: string) {
if (key.length !== 64 || !/^[0-9a-fA-F]+$/.test(key))
throw new Error(
"Invalid key: must be a 64-character hexadecimal string (32 bytes / 256 bits)",
);
}
constructor(private key: string) {}

encrypt(data: string): string {
const iv = crypto.randomBytes(16);
Expand Down

0 comments on commit 20e9523

Please sign in to comment.