@doctormckay/steam-crypto
Advanced tools
Comparing version 1.1.0 to 1.2.0
12
index.js
@@ -97,1 +97,13 @@ var Crypto = require('crypto'); | ||
}; | ||
/** | ||
* Decrypt something that was encrypted with AES/ECB/PKCS7 | ||
* @param {Buffer} input | ||
* @param {Buffer} key | ||
* @returns {Buffer} | ||
*/ | ||
exports.symmetricDecryptECB = function(input, key) { | ||
var decipher = Crypto.createDecipheriv('aes-256-ecb', key, ''); | ||
decipher.end(input); | ||
return decipher.read(); | ||
}; |
{ | ||
"name": "@doctormckay/steam-crypto", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Node.js implementation of Valve's crypto", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -11,3 +11,4 @@ # node-steam-crypto | ||
## generateSessionKey() | ||
## generateSessionKey([nonce]) | ||
- `nonce` - If you were prompted by Steam with a nonce, provide it here (as a Buffer) | ||
@@ -18,8 +19,21 @@ Generates a 32 byte random blob of data and encrypts it with RSA using the Steam system's public key. Returns an object with the following properties: | ||
## symmetricEncrypt(input, sessionKey) | ||
If you provided a nonce, then `encrypted` is the RSA'd concatenation of the session key and the nonce (in that order). | ||
Encrypts `input` using `sessionKey` and returns the result. | ||
## symmetricEncrypt(input, sessionKey[, iv]) | ||
## symmetricDecrypt(input, sessionKey) | ||
Encrypts `input` using `sessionKey` and `iv` (or a securely-random IV if you don't provide one) and returns the result. | ||
## symmetricEncryptWithHmacIv(input, sessionKey) | ||
Encrypts `input` using `sessionKey` and an IV which is partially comprised of an HMAC of the `input`. | ||
## symmetricDecrypt(input, sessionKey[, checkHmac]) | ||
Decrypts `input` using `sessionKey` and returns the result. | ||
If the IV in this ciphertext contains an HMAC, pass `true` for `checkHmac` and it will be validated. Otherwise, it will | ||
not be validated (default behavior). | ||
## symmetricDecryptECB(input, sessionKey) | ||
Decrypts `input` using `sessionKey` and the AES/ECB/PKCS7 cipher without an IV and returns the result. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23242
95
38
13