Init Commit

This commit is contained in:
ysandler 2018-09-28 14:00:01 -05:00 committed by Joshua Shoemaker
commit 3d11a7d24e
14 changed files with 633 additions and 0 deletions

BIN
AESdecode.exe Normal file

Binary file not shown.

BIN
AESencrypt.exe Normal file

Binary file not shown.

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# AES Hippa compliant encrypting node project
Attached are EXECUTABLES that run a compiled version of node so there is no need to run from the command line
The AESencrypt.EXE creates an encoded version of the file, and also dcrypts it afterwards to ensure it was encrytped properly
The AESdecode.EXE only creates a file from the decrypted file.

BIN
d8c5eccc/chilkat.node Normal file

Binary file not shown.

80
decode.js Normal file
View File

@ -0,0 +1,80 @@
var os = require('os')
if (os.platform() === 'win32') {
var chilkat = require('chilkat_node8_win32')
} else if (os.platform() === 'linux') {
if (os.arch() === 'arm') {
var chilkat = require('chilkat_node8_arm')
} else if (os.arch() == 'x86') {
var chilkat = require('chilkat_node8_linux32')
} else {
var chilkat = require('chilkat_node8_linux64')
}
} else if (os.platform() == 'darwin') {
var chilkat = require('chilkat_node8_macosx')
}
function chilkatExample () {
var crypt = new chilkat.Crypt2()
// Any string argument automatically begins the 30-day trial.
var success = crypt.UnlockComponent('30-day trial')
if (success !== true) {
console.log(crypt.LastErrorText)
return
}
crypt.CryptAlgorithm = 'aes'
// CipherMode may be "ecb" or "cbc"
crypt.CipherMode = 'cbc'
// KeyLength may be 128, 192, 256
crypt.KeyLength = 256
// The padding scheme determines the contents of the bytes
// that are added to pad the result to a multiple of the
// encryption algorithm's block size. AES has a block
// size of 16 bytes, so encrypted output is always
// a multiple of 16.
crypt.PaddingScheme = 0
// An initialization vector is required if using CBC mode.
// ECB mode does not use an IV.
// The length of the IV is equal to the algorithm's block size.
// It is NOT equal to the length of the key.
var ivHex = '000102030405060708090A0B0C0D0E0F'
crypt.SetEncodedIV(ivHex, 'hex')
// The secret key must equal the size of the key. For
// 256-bit encryption, the binary secret key is 32 bytes.
// For 128-bit encryption, the binary secret key is 16 bytes.
var keyHex = '000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'
crypt.SetEncodedKey(keyHex, 'hex')
// For demonstration purposes, a different instance of the object will be used
// for decryption.
var decrypt = new chilkat.Crypt2()
// All settings must match to be able to decrypt:
decrypt.CryptAlgorithm = 'aes'
decrypt.CipherMode = 'cbc'
decrypt.KeyLength = 256
decrypt.PaddingScheme = 0
decrypt.SetEncodedIV(ivHex, 'hex')
decrypt.SetEncodedKey(keyHex, 'hex')
// Decrypt the .aes
const inFile = './encodedData.zip.aes'
const outFile = './decodedData.zip'
console.log('Decodding...')
console.log('This may take a while depending on how large your file is...')
success = decrypt.CkDecryptFile(inFile, outFile)
if (success === false) {
console.log(decrypt.LastErrorText)
return
}
console.log('Success!')
}
chilkatExample()

98
index.js Normal file
View File

@ -0,0 +1,98 @@
// chilkat for other operating systems can only be installed truough npm on those systems
var os = require('os')
if (os.platform() === 'win32') {
var chilkat = require('chilkat_node8_win32')
} else if (os.platform() === 'linux') {
if (os.arch() === 'arm') {
var chilkat = require('chilkat_node8_arm')
} else if (os.arch() == 'x86') {
var chilkat = require('chilkat_node8_linux32')
} else {
var chilkat = require('chilkat_node8_linux64')
}
} else if (os.platform() == 'darwin') {
var chilkat = require('chilkat_node8_macosx')
}
function chilkatExample () {
var crypt = new chilkat.Crypt2()
// Any string argument automatically begins the 30-day trial.
var success = crypt.UnlockComponent('30-day trial')
if (success !== true) {
console.log(crypt.LastErrorText)
return
}
crypt.CryptAlgorithm = 'aes'
// CipherMode may be "ecb" or "cbc"
crypt.CipherMode = 'cbc'
// KeyLength may be 128, 192, 256
crypt.KeyLength = 256
// The padding scheme determines the contents of the bytes
// that are added to pad the result to a multiple of the
// encryption algorithm's block size. AES has a block
// size of 16 bytes, so encrypted output is always
// a multiple of 16.
crypt.PaddingScheme = 0
// An initialization vector is required if using CBC mode.
// ECB mode does not use an IV.
// The length of the IV is equal to the algorithm's block size.
// It is NOT equal to the length of the key.
var ivHex = '000102030405060708090A0B0C0D0E0F'
crypt.SetEncodedIV(ivHex, 'hex')
// The secret key must equal the size of the key. For
// 256-bit encryption, the binary secret key is 32 bytes.
// For 128-bit encryption, the binary secret key is 16 bytes.
var keyHex = '000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'
crypt.SetEncodedKey(keyHex, 'hex')
// Encrypt a file, producing the .aes as output.
// The input file is unchanged, the output .aes contains the encrypted
// contents of the input file.
// Note: The .aes output file has no file format. It is simply a stream
// of bytes that resembles random binary data.
var inFile = './rawData.zip'
var outFile = './encodedData.zip.aes'
console.log('Encoding...')
console.log('This may take a while depending on how large your file is...')
success = crypt.CkEncryptFile(inFile, outFile)
if (success !== true) {
console.log(crypt.LastErrorText)
return
}
// For demonstration purposes, a different instance of the object will be used
// for decryption.
var decrypt = new chilkat.Crypt2()
// All settings must match to be able to decrypt:
decrypt.CryptAlgorithm = 'aes'
decrypt.CipherMode = 'cbc'
decrypt.KeyLength = 256
decrypt.PaddingScheme = 0
decrypt.SetEncodedIV(ivHex, 'hex')
decrypt.SetEncodedKey(keyHex, 'hex')
// Decrypt the .aes
inFile = './encodedData.zip.aes'
outFile = './recoveredData.zip'
console.log('Decoding...')
console.log('This may take a while depending on how large your file is...')
success = decrypt.CkDecryptFile(inFile, outFile)
if (success === false) {
console.log(decrypt.LastErrorText)
return
}
console.log('Success!')
}
chilkatExample()

65
node_modules/chilkat_node8_win32/README.md generated vendored Normal file

File diff suppressed because one or more lines are too long

BIN
node_modules/chilkat_node8_win32/chilkat.node generated vendored Normal file

Binary file not shown.

249
node_modules/chilkat_node8_win32/license.txt generated vendored Normal file
View File

@ -0,0 +1,249 @@
Chilkat Software License
PLEASE READ THIS AGREEMENT BEFORE OPENING THIS SOFTWARE
PACKAGE. IF YOU OPEN THIS PACKAGE OR KEEP IT FOR MORE THAN
THIRTY (30) DAYS, YOU ACCEPT ALL THE TERMS AND CONDITIONS OF
THIS AGREEMENT. IF YOU DO NOT AGREE TO THESE TERMS AND
CONDITIONS, DO NOT OPEN THIS SOFTWARE PACKAGE. YOU MAY ONLY
UNLOCK AND/OR USE THE SOFTWARE FOR WHICH YOU HAVE A PAID- UP
LICENSE OR FOR WHICH YOU HAVE LEGALLY RECEIVED AN UNLOCK
KEY.
(1) DEFINITION OF TERMS
"Documentation": any explanatory written or on- line
material including, but not limited to, user guides,
reference manuals and HTML files.
"Licensee": shall refer to the individual licensee, whether
as an individual programmer, company, or other organization.
"Software": All material in this distribution including, but
not limited to, one or more of the following: source code,
object code, byte code, dynamic-link libraries, shared
libraries, static libraries, header files, executables,
scripts, sample programs, utility programs, makefiles and
Documentation.
"Licensed Software": the Software for which Licensee has
paid the applicable license fee and received an authorized
unlock key.
"Software Application Programming Interface ("API")": the
set of access methods, whether provided by Chilkat Software,
third parties, or developed by Licensee, through which the
programmatic services provided by the Licensed Software are
made available.
"End-User Software Product": an application developed by
Licensee intended for execution on a computer, that makes
use of the Licensed Software in its implementation.
The Licensed Software contains certain runtime libraries and
files intended for duplication and distribution by Licensee
within End User Software Products to the user(s) of the End
User Software Product(s) (the "Redistributable Components").
The Redistributable Components are those files specifically
designated as being distributable as part of the Licensed
Software.
SPECIAL LIMITED TERM EVALUATION LICENSE
If Licensee has been provided with a copy of the Software
for evaluation purposes, Chilkat Software, Inc. ("Chilkat")
grants to Licensee, subject to the terms of this Single User
License Agreement (excluding Section 3, under which Licensee
has no rights) a non-exclusive, non- transferable, non-
concurrent limited internal use license for evaluation
purposes only. This license is for a period of thirty (30)
days, commencing upon receipt of the Software, or, if
received electronically, from Licensee's initial downloading
date, to evaluate the Software. If the Software is
acceptable, Licensee agrees to promptly notify his Chilkat
Sales Representative. Otherwise, Licensee shall immediately
cease any further use of the Software and destroy all copies
of the Software (including the original) and related
Documentation provided to Licensee by Chilkat.
(2) GENERAL
The Software is owned by Chilkat Software, Inc. ("Chilkat")
and is protected by U.S. copyright laws and other laws and
by international treaties. It is intended for use by a
software programmer who has experience using development
tools and class libraries.
(3) LICENSE GRANTS
(a) Per-developer license. Subject to the terms and conditions of this Agreement ,
Chilkat grants to Licensee the perpetual, non-exclusive, non-transferable, world-wide
license for one (1) developer to (i) install and use the Licensed Software on any
number of computers, and (ii) use the associated user documentation and online help.
(b) Site-wide license. If you have purchased a site-wide license, the following rights
apply notwithstanding section 3(a): Subject to the terms and conditions of this Agreement
, Chilkat grants to Licensee the perpetual, non-exclusive, non-transferable, world-wide
license for any number of developers at a single Licensee's office location to (i)
install the Licensed Software on any number of computers across Licensee's enterprise,
and (ii) use the associated user documentation and online help.
(c) Licensee may also:
(i) Make one backup copy of the Licensed Software solely for archival and
disaster-recovery purposes, or transfer the Licensed Software to a hard disk and
keep the original copy solely for archival and disaster-recovery purposes; and
(ii) Reproduce and distribute the Redistributable Components directly or indirectly for
any number of applications to any number of end users and Licensee's Authorized OEMs,
VARs and Distributors, through customary distribution channels, world wide, on a royalty
free basis provided that such distribution is (i) in conjunction with an End User
Software Product developed by Licensee using the Licensed Software and (ii) the Licensed
Software is not the sole or primary component of such End User Software Product.
(iii) The license rights granted under this Agreement do not apply to development and
distribution of software development products or toolkits of any kind that are destined
to be used by software developers other than Licensee(s) that are Authorized.
Licensee has no rights to use the Licensed Software beyond those specifically granted
in this section.
(4) LICENSE RESTRICTIONS
EXPORT CONTROLS: If the Software is for use outside the
United States of America, Licensee agrees to comply with all
relevant regulations of the United States Department of
Commerce and with the United States Export Administration
Act to insure that the Software is not exported in violation
of United States law.
Notwithstanding any provisions in this Agreement to the
contrary, Licensee may not distribute any portion of the
Software other than the Redistributable Components.
In addition, Licensee may not decompile, disassemble, or
reverse engineer any object code form of any portion of the
Software.
(5) TITLE
Licensee acknowledges and agrees that all right, title and
interest in and to the Software, including all intellectual
property rights therein, are the property of Chilkat,
subject only to the licenses granted to Licensee under this
Agreement. This Agreement is not a sale and does not
transfer to the Licensee any title or ownership in or to the
Software or any patent, copyright, trade secret, trade name,
trademark or other proprietary or intellectual property
rights related thereto.
(6) NON-TRANSFERABILITY
Except for Licensee's rights to distribute the
Redistributable Components, Licensee may not rent, transfer,
assign, sublicense or grant any rights in the Software, in
full or in part, to any other person or entity without
Chilkat's written consent, except that this agreement may be
assigned to a successor of Licensee in the case that all or
substantially all of the assets or equity of Licensee are
acquired by the successor.
(7) LIMITED WARRANTIES
Chilkat warrants to Licensee that the Licensed Software will
substantially perform the functions described in the
Documentation for a period of thirty (30) days after the
date of delivery of the Licensed Software to Licensee.
Chilkat's sole and exclusive obligation, and Licensee's sole
and exclusive remedy, under this warranty is limited to
Chilkat's using reasonable efforts to correct material,
documented, reproducible defects in the Licensed Software
that Licensee describes and documents to Chilkat during the
thirty (30) day warranty period. In the event that Chilkat
fails to correct a material, documented, reproducible defect
during this period, Chilkat may, at Chilkat's discretion,
replace the defective Licensed Software or refund to
Licensee the amount that Licensee paid Chilkat for the
defective Licensed Software and cancel this Agreement and
the licenses granted herein. In such event, Licensee agrees
to return to Chilkat all copies of the Licensed Software
(including the original).
EXCEPT AS EXPRESSLY SET FORTH ABOVE, CHILKAT EXPRESSLY DISCLAIMS ALL OTHER WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF TITLE, NON-INFRINGEMENT,
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, RESULTS, OR OTHERWISE
(8) LIMITATION OF LIABILITY
IN NO EVENT SHALL CHILKAT BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS, REVENUES,
DATA OR OTHER ECONOMIC ADVANTAGE) WHETHER BASED ON CONTRACT, TORT, OR ANY OTHER LEGAL THEORY,
EVEN IF CHILKAT WAS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. NOTWITHSTANDING THE FOREGOING,
THE TOTAL AMOUNT OF CHILKAT'S LIABILITY TO LICENSEE SHALL BE LIMITED TO THE AMOUNT USER PAID
FOR THE USE OF THE SOFTWARE, IF ANY.
(9) TERMINATION
Chilkat reserves the right, at its sole discretion, to
terminate this Agreement upon written notice if Licensee has
breached the terms and conditions hereof. Licensee may
terminate this Agreement at any time by ceasing to use the
Licensed Software and by destroying all copies of the
Licensed Software (including the original). Sections 4, 5,
6, 7, 8, 9 and 10 survive any termination of this Agreement
and apply fully to any termination. Unless terminated as
provided herein by either party, this Agreement shall remain
in effect. Termination will not affect end user licenses of
the End User Software Product which contain the
Redistributable Components which were distributed by
Licensee prior to termination.
(10) MISCELLANEOUS
Applicable Law and Jurisdiction. This Agreement will be
governed by and construed in accordance with the laws of the
State of Illinois without regard to conflict of laws
principles and without regard to the 1980 U.N. Convention on
Contracts for the International Sale of Goods. The federal
and state courts of Illinois shall have exclusive
jurisdiction and venue to adjudicate any dispute arising out
of this Agreement, and Licensee expressly consents to (i)
the personal jurisdiction of the state and federal courts of
Illinois, and (ii) service of process being effected upon
Licensee by registered mail.
Limitation of Actions. No action, regardless of form, may be
brought by either party more than twelve (12) months after
the cause of action has arisen. No such claim may be brought unless
Chilkat has first been given commercially reasonable notice,
a full written explanation of all pertinent details
(including copies of all materials), and a good faith
opportunity to resolve the matter.
Invalidity and Waiver. Should any provision of this
Agreement be held by a court of law to be illegal, invalid,
or unenforceable, the legality, validity, and enforceability
of the remaining provisions of this Agreement will not be
affected or impaired thereby. The failure of any party to
enforce any of the terms or conditions of this Agreement,
unless waived in writing, will not constitute a waiver of
that party's right to enforce each and every term and
condition of this Agreement.
U.S. Government Restricted Rights. The Licensed Software is
provided with Restricted Rights. Use, duplication, or
disclosure by the Government is subject to restrictions as
set forth in subparagraph (c) (1) (ii) of The Rights in
Technical Data and Computer Software clause at DFARS
252.227-7013 or subparagraphs (c) (1) and (2) of the
Commercial Computer Software Restricted Rights at 48 CFR
52.227- 19, as applicable. Manufacturer is Chilkat Software,
Inc., 1719 E Forest Ave, Wheaton, Illinois 60187 USA.
LICENSEE ACKNOWLEDGES THAT HE HAS READ THIS AGREEMENT,
UNDERSTANDS IT AND AGREES TO BE BOUND BY ITS TERMS AND
CONDITIONS. LICENSEE FURTHER AGREES THAT IT IS THE COMPLETE
AND EXCLUSIVE STATEMENT OF THE AGREEMENT BETWEEN LICENSEE
AND CHILKAT WHICH SUPERSEDES ANY PROPOSAL OR PRIOR OR
CONTEMPORANEOUS AGREEMENT, ORAL OR WRITTEN, AND ANY OTHER
COMMUNICATIONS RELATING TO THE SUBJECT MATTER OF THIS
AGREEMENT

98
node_modules/chilkat_node8_win32/package.json generated vendored Normal file
View File

@ -0,0 +1,98 @@
{
"_from": "chilkat_node8_win32",
"_id": "chilkat_node8_win32@9.50.75",
"_inBundle": false,
"_integrity": "sha512-3AXtqJJrwf8wklsgKkQPOFzNz6l+EES9iAzufyZd3UdwNAQzgT3BiyB7m8mcDU/RDXuhcrO9ZQu5RaJhIlfIYA==",
"_location": "/chilkat_node8_win32",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "chilkat_node8_win32",
"name": "chilkat_node8_win32",
"escapedName": "chilkat_node8_win32",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/chilkat_node8_win32/-/chilkat_node8_win32-9.50.75.tgz",
"_shasum": "0a5652e785034e728fe8ad9b3b5af176dcebd38a",
"_spec": "chilkat_node8_win32",
"_where": "C:\\Users\\joshu\\Documents\\github\\AESencrypt",
"author": {
"name": "Chilkat Software, Inc.",
"email": "support@chilkatsoft.com",
"url": "http://www.chilkatsoft.com/"
},
"bundleDependencies": false,
"cpu": [
"x64"
],
"deprecated": false,
"description": "Chilkat classes for Node.js",
"engines": {
"node": ">=8.0.0 <9.0.0"
},
"keywords": [
"chilkat",
"SSH",
"SFTP",
"FTP",
"FTPS",
"POP3",
"SMTP",
"REST",
"JWT",
"OAuth2",
"IMAP",
"Certificate",
"ASN.1",
"PKCS7",
"Signature",
"RSA",
"DSA",
"ECC",
"S3",
"S/MIME",
"MIME",
"Email",
"PFX",
"PEM",
"SCP",
"Java KeyStore",
"GZip",
"DKIM",
"MHT",
"HMAC",
"Hashing",
"Compression",
"Socket",
"TLS",
"SSL",
"SSH Tunnel",
"Encoding",
"Charset",
"Zip",
"HTTP",
"Encryption"
],
"licenses": [
{
"type": "Chilkat",
"url": "http://www.chilkatsoft.com/licensingExplained.asp"
}
],
"main": "chilkat.node",
"name": "chilkat_node8_win32",
"os": [
"win32"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "9.50.75"
}

13
package-lock.json generated Normal file
View File

@ -0,0 +1,13 @@
{
"name": "aesencrypt",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"chilkat_node8_win32": {
"version": "9.50.75",
"resolved": "https://registry.npmjs.org/chilkat_node8_win32/-/chilkat_node8_win32-9.50.75.tgz",
"integrity": "sha512-3AXtqJJrwf8wklsgKkQPOFzNz6l+EES9iAzufyZd3UdwNAQzgT3BiyB7m8mcDU/RDXuhcrO9ZQu5RaJhIlfIYA=="
}
}
}

22
package.json Normal file
View File

@ -0,0 +1,22 @@
{
"name": "aesencrypt",
"version": "1.0.0",
"description": "Encrypt and decrypt files for AES methods",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/joshuashoemaker/AESencrypt.git"
},
"author": "Joshua Shoemaker",
"license": "ISC",
"bugs": {
"url": "https://github.com/joshuashoemaker/AESencrypt/issues"
},
"homepage": "https://github.com/joshuashoemaker/AESencrypt#readme",
"dependencies": {
"chilkat_node8_win32": "^9.50.75"
}
}

BIN
rawData.zip Normal file

Binary file not shown.

1
rawData/sample.txt Normal file
View File

@ -0,0 +1 @@
Hello World