Aes Is Currently Down for Maintenance Please Try Again Later чã‘‚ã⾠Ñâãâ»ã‘æ’㑇ãâ¸ãâ»ãâ¾ã‘âã‘å’
kruptein
crypto; from kruptein to hide or muffle.
Install
To install npm install kruptein
Methods
-
.ready(secret, plaintext, [aad], callback) -
.get(hush-hush, ciphertext, [{at: auth_tag, aad: aad}], callback)
Options
Industry standards are used for the algorithm, hashing algorithm, primal & IV sizes. The default key derivation is pbkdf2, however use of the scrypt derivation function can exist enabled.
-
algorithm: (Optional) Naught algorithm fromcrypto.getCiphers(). Default:aes-256-gcm. -
hashing: (Optional) Hash algorithm fromcrypto.getHashes(). Default:sha512. -
encodeas: (Optional) Output encoding. Currently supportsbinary,hex, &base64. Default:base64. -
key_size: (Optional) Key size bytes (should lucifer block size of algorithm). Default:32 -
iv_size: (Optional) Four size bytes. Default:sixteen. -
at_size: (Optional) Hallmark tag size. Applicative togcm&ocbcipher modes. Default:128. -
use_scrypt: (Optional) Utilise.scrypt()to derive a key. Requires node > v10. Default/Fallback:.pbkdf2(). -
use_asn1: (Optional) Disable the default ASN.1 encoding. Default: truthful
Usage
When selecting an algorithm from crypto.getCiphers() the iv and key_size values are calculated auto-magically to make implementation piece of cake.
You tin always ascertain your own if the defaults per algorithm and mode aren't what you would like; see the options department in a higher place.
Create ciphertext from plaintext
To create a new ciphertext object.
const kruptein = require ( "kruptein" ) ( opts ) ; let surreptitious = "squirrel" ; kruptein . set ( secret , "Operation mincemeat was an example of deception" , ( err , ct ) => { if ( err ) throw err ; panel . log ( ct ) ; } ) ; Get plaintext from ciphertext
To retrieve plaintext from a ciphertext object.
const kruptein = require ( "kruptein" ) ( opts ) ; let ciphertext , hugger-mugger = "squirrel" ; kruptein . get ( secret , ciphertext , ( err , pt ) => { if ( err ) throw err ; console . log ( pt ) ; } ) ; Output
The .ready() method output depends on 3 factors; the encodeas, algorithm and use_asn1.
For whatsoever algorithm that supports authentication (AEAD), the object structure includes the Authentication Tag and the Additional Authentication Data attribute and value.
When the use_asn1 option is enabled (default is true), the result is an ASN.i value using the encodeas value. While this is a more circuitous encoding option, it helps standardize & minimize the resulting ciphertext output.
ASN.one Encoding
When the use_asn1 option is enabled an ASN.1 value encoded with the format specifed with encodeas option is returned regardless of the cipher mode. This render type volition ensure compatibility with various database engines and the character set encoding available for them.
Examples:
# enocdeas = binary 0\u0001n\u0004\u0019Âû ìÃ#$Ãôý\u001d(a6'P>\u00042éUÃÃ2è©kÂdkçEö«\"°ÂÂLI,ý<\rñI»\b\u0004\u0010N6K±ü\u001eC\nÃî.E\u0004À¿K¼nO¶%ÂÂÃÃ&jc6_ê.Wû}Ãy`1KCZiÂÃ'QHï\rÂqæà ô\u0011÷ÂFfÂë\\`\u0015º§ÂÂÂ\u000fÂÃÂ\u0014TÂÂPå¸Ãô}ý\u0002°1¡Ã¯ðÂÃ\u0015%j$<ãå\nýæÃdæëL ÂT@five\\]\u001a\u0006³Ã;XÂ\b\u0005Â¥d8\u0017袧µý\"ôû\u0019\u0004\u0010:\"çM¦ÔÖÌE\u001fEÌ\b\u00046=²Â¿ý9á Ã\u0001øáõÂý#þÂãþùºN%àÃÂH # encodeas = hex 308201d80422313764663766313962303939393863306536366436643837646233346263386338630440373661643461633462653765343330393738363164646139636663343139646165386533363838333836613133376431623930373138326532663035613232300418656437323161333938323737393231623463613835383563048201006634346438623633316162343762396163303739393931336266633464356162323633356163313635383533613232623934386464646161323762303839646130623764323830303063303938333332343462383536323737383134386262653261383937623562376538613730333834616233363939613366633433636630616231663366636364393038356436653135343666626364313030643761333563623530313030333838316264346133663961313961336666343132323535386266383764613863643437336635383938326161666637646533303030373564643034623264383862333733323332333565386132626234383461663530623604102b981bf150521b81819449afa614c644044062353937313939343438623035663932383837363763343161636335653634393664313634303430343833346466626634646462653963663730303462353739 # encodeas = base64 MIIBSQQYakpmVURhKzE1Qml1SGQyUGdKUnI2RFk9BCxtb1BmcFNPU3ZicXpBSHQzcTlpRTMvRkdrVlk3cHpvTHd4dmR3bUdIcHVFPQQQUzc3eVczRndzdDdUQXhYcgSBrFhVYXVtdDV4Vmo5T1A0TE85L0dYMmNSdkFQSGZUNGhUa2sycVdUWGs3R05EZnI0QXZRMmdJYWREVHFZVmFRdjQzcXNWeUQzcXVpWVRRbXZSM0lNeUIzUnBlc0dIeDFMWHFOdDFXWXFONVdLVnhHQzVXcEc4dVdpc2t5bEh4bWNGcDRlUFNKMDJaUGpkSytGOGxJNzZ0bnJSYWJSemxaN0RNNmhYeFpnWEdtUT0EEE5WruRF8rNh3q0MHjdhZz8ELE91ZjFMUERhdW5JOHJSODNGeVd2cU56ZmZFQWdxUUVFdlpMZkx6VEdGbk09 Non-Authenticated Ciphers
For those ciphers that Practice Non back up hallmark modes the following structure is returned when the use_asn1 option is disabled.
{ 'hmac': "<binary format of calculated hmac>", 'ct': "<binary format of resulting ciphertext>", 'iv': "<buffer format of generated/supplied iv>", 'salt': "<buffer format of generated/supplied table salt>" } Authenticated Ciphers
For those ciphers that DO support hallmark modes the following structure is returned when the use_asn1 option is disabled.
Important: Note that in the effect additional authentication data (aad) is not provided a random 128 byte salt is used.
{ 'hmac': "<binary format of calculated hmac>", 'ct': "<binary format of resulting ciphertext>", 'four': "<buffer format of generated/supplied four>", 'common salt': "<buffer format of generated/supplied salt>", 'at': "<buffer format of generated authentication tag>", 'aad': "<buffer format of generated/supplied boosted authentication data>" } Test harness
The included exam harness, invoked with npm test, makes every attempt to trap and handle errors. Some of which come from side channel or possible malability of the resultant ciphertext.
This can be seen within the test/alphabetize.js CI exam harness under the HMAC, AT & AAD validation test cases.
Cryptography References
This module conforms to industry recommendations regarding algorithm type, mode, fundamental size, 4 size & implementation, digests, key derivation & management etc. References used provided here:
RFC:
- RFC 2104: HMAC: Keyed-Hashing for Bulletin Authentication
- RFC 4086: Randomness Requirements for Security
- RFC 5084: Using AES-CCM and AES-GCM Authenticated Encryption
- RFC 7914: The scrypt Password-Based Cardinal Derivation Function
- RFC 8018: Password-Based Cryptography Specification
- X.697: ASN.ane encoding rules: Specifications of JavaScript Object Annotation Encoding Rules (JER)
NIST:
- SP 800-38A: Cake zero modes of operation
- SP 800-38B: Recommendation for Block Goose egg Modes of Operation: Galois/Counter Mode (GCM) and GMAC
- SP 800-57P1: Recommendations for key management
- SP 800-107: Recommendation for Applications Using Canonical Hash Algorithms
- SP 800-108: Recommendation for Key Derivation Using Pseudorandom Functions
- SP 800-131A: Transitioning the Utilize of Cryptographic Algorithms and Central Lengths
- SP 800-132: Recommendation for Password-Based Central Derivation
- SP 800-175B: Guideline for Using Cryptographic Standards in the Federal Authorities
FIPS:
- FIPS 197: Advanced Encryption Standard (AES)
- FIPS 198-1: The Keyed-Hash Bulletin Authentication Code (HMAC)
- FIPS 180-4: Secure Hash Standard (SHS)
Contributing
Contributions are welcome & appreciated!
Refer to the contributing document to help facilitate pull requests.
License
This software is licensed nether the MIT License.
Copyright Jason Gerfen, 2019.
Source: https://www.npmjs.com/package/kruptein?activeTab=readme
0 Response to "Aes Is Currently Down for Maintenance Please Try Again Later чã‘‚ã⾠Ñâãâ»ã‘æ’㑇ãâ¸ãâ»ãâ¾ã‘âã‘å’"
Post a Comment