Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
node-jose cyrillic support, how to?

https://github.com/cisco/node-jose it's my code example:

    let keystore1;
    let keystore2;
    keystore1 = JWK.createKeyStore();
    keystore2 = JWK.createKeyStore();

    const input = { message: { text: 'Привет!' } };

    const priv1 = await keystore1.generate('EC', 'P-256', {
      kid: '1gBdaS-G8RLax2qgObTD94w',
      key_ops:["sign", "decrypt", "unwrap"]
    });
    const priv2 = await keystore2.generate('EC', 'P-256', {
      kid: '2gBdaS-G8RLax2qgObTD94v',
      key_ops:["sign", "decrypt", "unwrap"]
    });

    const pub1 = await JWK.asKey(priv1.toJSON());
    const pub2 = await JWK.asKey(priv2.toJSON());
    const encrypted = await JWE.createEncrypt(
      {
        format: 'compact',
        fields: {
          alg: 'ECDH-ES',
          enc: 'A128CBC-HS256',
          cty: 'json', // replace with JWT if you're encrypting a JWT...
        },
      },
      {
        key: pub2,
      }
    )
      .update(JSON.stringify(input))
      .final();

    console.log('encrypted', encrypted);

    const decrypted = await JWE.createDecrypt(priv2).decrypt(encrypted);

    console.log('decrypted', JSON.parse(decrypted.payload.toString()));

// simulate only having access to the public key, usually this is your starting point as you only have access to the public components if you're encrypting a message for someone else.

With latin - decryption ok! How to decrypte with cyrillic, please help me.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can pass the encoding to the update function.

e.g.JWE.createEncrypt(...).update(input, "utf8")

Doc

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda