
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
57 lines
1.6 KiB
Plaintext
57 lines
1.6 KiB
Plaintext
include::../description.adoc[]
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
== Sensitive Code Example
|
|
|
|
----
|
|
// === Client side ===
|
|
crypto.subtle.encrypt(algo, key, plainData); // Sensitive
|
|
crypto.subtle.decrypt(algo, key, encData); // Sensitive
|
|
----
|
|
|
|
----
|
|
// === Server side ===
|
|
const crypto = require("crypto");
|
|
const cipher = crypto.createCipher(algo, key); // Sensitive
|
|
const cipheriv = crypto.createCipheriv(algo, key, iv); // Sensitive
|
|
const decipher = crypto.createDecipher(algo, key); // Sensitive
|
|
const decipheriv = crypto.createDecipheriv(algo, key, iv); // Sensitive
|
|
const pubEnc = crypto.publicEncrypt(key, buf); // Sensitive
|
|
const privDec = crypto.privateDecrypt({ key: key, passphrase: secret }, pubEnc); // Sensitive
|
|
const privEnc = crypto.privateEncrypt({ key: key, passphrase: secret }, buf); // Sensitive
|
|
const pubDec = crypto.publicDecrypt(key, privEnc); // Sensitive
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 5 Dec 2018, 21:29:19 Alexandre Gigleux wrote:
|
|
\[~lars.svensson] What about ``++crypto.publicEncrypt++``, ``++crypto.publicDecrypt++``, ``++crypto.privateDecrypt++``, ``++crypto.privateEncrypt++`` from \https://nodejs.org/api/crypto.html#crypto_crypto_publicdecrypt_key_buffer ?
|
|
|
|
=== on 6 Dec 2018, 21:34:46 Lars Svensson wrote:
|
|
https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto
|
|
|
|
https://nodejs.org/api/crypto.html
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|