Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid key length on CALENDSO_ENCRYPTION KEY #333

Open
ozzyoss77 opened this issue Feb 26, 2024 · 1 comment
Open

Invalid key length on CALENDSO_ENCRYPTION KEY #333

ozzyoss77 opened this issue Feb 26, 2024 · 1 comment

Comments

@ozzyoss77
Copy link

Hello everyone, I have a deployment of cal.com with the following characteristics:

  • AWS EC2 instance with 2VCPU and 2GB RAM, Ubuntu 22.04 LTS.
  • Docker Compose deployment.

Everything works fine, but when trying to activate 2FA, it tells me that something went wrong. Checking the Docker Compose logs, I have this message in the console:

RangeError: Invalid key length calcom-1 | @calcom/web:start: at Cipheriv.createCipherBase (node:internal/crypto/cipher:122:19) calcom-1 | @calcom/web:start: at Cipheriv.createCipherWithIV (node:internal/crypto/cipher:141:3) calcom-1 | @calcom/web:start: at new Cipheriv (node:internal/crypto/cipher:249:3) calcom-1 | @calcom/web:start: at Object.createCipheriv (node:crypto:141:10) calcom-1 | @calcom/web:start: at symmetricEncrypt (/calcom/apps/web/.next/server/chunks/69559.js:1:278) calcom-1 | @calcom/web:start: at handler (/calcom/apps/web/.next/server/pages/api/auth/two-factor/totp/setup.js:1:3027) { calcom-1 | @calcom/web:start: code: 'ERR_CRYPTO_INVALID_KEYLEN' calcom-1 | @calcom/web:start: } calcom-1 | @calcom/web:start: RangeError: Invalid key length calcom-1 | @calcom/web:start: at Cipheriv.createCipherBase (node:internal/crypto/cipher:122:19) calcom-1 | @calcom/web:start: at Cipheriv.createCipherWithIV (node:internal/crypto/cipher:141:3) calcom-1 | @calcom/web:start: at new Cipheriv (node:internal/crypto/cipher:249:3) calcom-1 | @calcom/web:start: at Object.createCipheriv (node:crypto:141:10) calcom-1 | @calcom/web:start: at symmetricEncrypt (/calcom/apps/web/.next/server/chunks/69559.js:1:278) calcom-1 | @calcom/web:start: at handler (/calcom/apps/web/.next/server/pages/api/auth/two-factor/totp/setup.js:1:3027) { calcom-1 | @calcom/web:start: code: 'ERR_CRYPTO_INVALID_KEYLEN' calcom-1 | @calcom/web:start: }

From what I understand, there is an issue with the length of the secret used to encrypt the information. Can someone help me with the necessary specifications to get this accepted?

I'm already using openssl rand -base64 32 to generate a random string, but I still can't get it to work.

Thanks in advance.

@johan-cruxdata
Copy link

have you tried the old guidance of openssl rand -base64 24?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants