{"_id":"s-des-ts","_rev":"2-9582657b96a40d0ec8f81e8297d62377","name":"s-des-ts","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"s-des-ts","version":"1.0.0","description":"This packages has core functionalities for s-des encryption and decryption","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"run":"ts-node src/index.ts","build":"tsc","prepublishOnly":"npm test && npm run lint","test":"jest --config jest.config.js","format":"prettier --write \"src/**/*.ts\" \"src/**/*.js\"","lint":"tslint -p tsconfig.json","version":"npm run format && git add -A src","postversion":"git push && git push --tags"},"keywords":["s-des","encryption","decryption"],"author":{"name":"Abtin Okhovat"},"license":"ISC","devDependencies":{"@types/jest":"^29.5.0","prettier":"^2.8.7","ts-jest":"^29.1.0","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","tsup":"^6.7.0","typescript":"^5.0.3"},"gitHead":"b2db7e41063e47c73d423543749e886cc638e3d8","_id":"s-des-ts@1.0.0","_nodeVersion":"14.19.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-vSo6+Gyg+pvIILyaQ9AHSQcni8nU/gKXl6MxpNGsBVSR/qBsi79s7+3604cqkYdQ6ue/aUV0v6/xLUO08HCw1g==","shasum":"4ba2291b4636e21241c6344b5147513329dea06c","tarball":"https://registry.npmjs.org/s-des-ts/-/s-des-ts-1.0.0.tgz","fileCount":20,"unpackedSize":17090,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzTI+tpCTV7ApaGZ28ZuKxsFms5J6SwQXFSyH5NlagjwIhAIIMUeXIAfRiRLxqsrWvOtgnAPIDq1Kf7DSAq6Cak2fD"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMqIoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPyA/+Le4FS8wd1C8rK4l/Qwm+gaMLdaCfEa+5sQeNXMGYyFqV61g1\r\nnnPdyc9zeu8SiknKf9A01FfA2WNeZTjs1OpOig1Jb7YkbcXrvUJxCOdyKBEB\r\nuQcVDBgkhsWCN15u29xVwu+2QeOI3hSno9DTiz5qf+KMuTtulEZCkWam+dIf\r\naVuDt9Tns0DaGifDrsUSDNeUEmy7g0NKAGlKLgXrH5SB6S8IXkmukxS614Xk\r\n9C7I8M9/57lbA/nAgx5+n8lII6I6iXFQj1lZyuDRe63KofaWhUnwxv1Gv06c\r\nscQHAiBRMFL2nxktPwsv97ReEu7pRsy8x/GJll9uhnwUVv38IhCMV6Fsi2RK\r\nA2I9D6LMuib11elmvwdGPOUqzVn6Rbn6PiAYfyzoB80FYtm7j/6LhUEKoKuT\r\noEF3vymkMx0S/SGPoY8DQdTSZJS9BqlQ+aRqFqYtxZz9Y5jpFfFisku2q+vY\r\nyy1g7l40nKtPgvcoRr2/bwktpBqWKSZf25ieyzGFbf5CWH8aMSVYgFPFK3/V\r\niP11sWwY/+Tpii+8fGEIiM+c1+oczxb0tjdP4T3mbr0YmHwgS499HdYIps2u\r\nmxJCUC+IUyZavV3eYLj3JqwomlS75ireZ6/oQN7IVVvifrp1PQmeJyJi09xF\r\n95wt4jTFokOWjw5Ne5AJ3gJj/wrZ8vaUBeQ=\r\n=brTu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"abtinokhovat","email":"abtinokhovat@gmail.com"},"directories":{},"maintainers":[{"name":"abtinokhovat","email":"abtinokhovat@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-des-ts_1.0.0_1681039911885_0.873903659962503"},"_hasShrinkwrap":false},"1.1.0":{"name":"s-des-ts","version":"1.1.0","description":"This packages has core functionalities for s-des encryption and decryption","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"play":"ts-node src/playground.ts","build":"tsc","prepublishOnly":"npm test && npm run lint","test":"jest --config jest.config.js","format":"prettier --write \"src/**/*.ts\" \"src/**/*.js\"","lint":"tslint -p tsconfig.json","version":"npm run format && git add -A src","postversion":"git push && git push --tags"},"keywords":["s-des","encryption","decryption"],"author":{"name":"Abtin Okhovat"},"license":"ISC","devDependencies":{"@types/jest":"^29.5.0","prettier":"^2.8.7","prettier-plugin-jsdoc":"^0.4.2","ts-jest":"^29.1.0","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^5.0.3"},"gitHead":"8a0965540b8261a390e04b65c0b9c8899387abc9","_id":"s-des-ts@1.1.0","_nodeVersion":"14.19.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-c0oyRHkJ5L99Q/brjt3jUtVcGewiWhHQZDh1PxA7RxKPg4lXPUJw1sYthKU5cMPoc9KvfBMRG4R1cuOUYPcQCw==","shasum":"b0b10634c44bd15f27382b7a0a1649f0bf687fab","tarball":"https://registry.npmjs.org/s-des-ts/-/s-des-ts-1.1.0.tgz","fileCount":28,"unpackedSize":36519,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJzBPdggDapUCjon1gqsabAcRK3iU5k6XnSFA0btf4QwIgYjuhhoFhWMZhTUgtbuV99rw1fZfT0c55hKGKhn/QDb0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNw0MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0Sg//VWw3eaLxbUDA/Wb+FbJsNJWU5uV0H032PQiL9El/hA+JEzSO\r\nqxfLjduPF0HaNlAH4dEtGrSVnXM/ES9+/Z3GgsiELykUB2uIq/7Kq47jW4RU\r\nEekNzAOqCxvTfMkTlbTNWZC5/6OiqzApR6pk+TPV/EqiZXm7bVZ2zeHGA/6M\r\nJ4dRU9B71wImP3e3poHs05HPA7FE7gtYXlnPcAHwKE92rnWjNmveUSJ3Z0QK\r\nZyvd6KWxo+9Z/SDnEjSgP4/2K0D5O91FdmvghHwsNAS33WirjWCwrfzakOr6\r\nvyz3zLBcWaur4/+zPZfmP3PLZRXn48aNOqjDcuf8yPWZHT3w4+NqMClMIu19\r\nURbe9DuDs8/BZJNM0Ep/sYPlwMo9o+fMGcOGVZdqBB0NGtOChKNlzqxJX9E0\r\n72cdvYTl5u1AbNpUqETDSYK7VuyLj7kuOiPpZbf0e8xYTMP5fzppA4PD5XPy\r\nl0V7qxjio+AZBD2931UVbBsCVB645ns3VCQZsudCA/f5bgwtfB6xxkP00W7c\r\n2xbIbA3UKWFovm5zYDaD5j0d/FDBooXSzBN3wcUeK4YHzOGSHrW42Uf+oQRs\r\niFaNwf77zL4u5s/TcURGRWkkdqZFXFuzWqsb1CoRsld2yRhPFHt4Dv7BGsoA\r\nW4CEVYY4cN6dV5GRqoaezOBY+OM90nFcJ7E=\r\n=BHIC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"abtinokhovat","email":"abtinokhovat@gmail.com"},"directories":{},"maintainers":[{"name":"abtinokhovat","email":"abtinokhovat@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-des-ts_1.1.0_1681329419777_0.7815308037203572"},"_hasShrinkwrap":false},"1.1.1":{"name":"s-des-ts","version":"1.1.1","description":"This packages has core functionalities for s-des encryption and decryption","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"play":"ts-node src/playground.ts","build":"tsc","prepublishOnly":"npm test && npm run lint","test":"jest --config jest.config.js","format":"prettier --write \"src/**/*.ts\" \"src/**/*.js\"","lint":"tslint -p tsconfig.json","version":"npm run format && git add -A src","postversion":"git push && git push --tags"},"keywords":["s-des","encryption","decryption"],"author":{"name":"Abtin Okhovat"},"license":"ISC","devDependencies":{"@types/jest":"^29.5.0","prettier":"^2.8.7","prettier-plugin-jsdoc":"^0.4.2","ts-jest":"^29.1.0","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^5.0.3"},"gitHead":"8a0965540b8261a390e04b65c0b9c8899387abc9","_id":"s-des-ts@1.1.1","_nodeVersion":"14.19.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-UHmcR9WdFFTFUYysg4a81be4Vr3NjL+IzSeAWFwNeJAVoJTBRuhzkb8TqHXu0bp233r9B1qpw1r84nik4KcuaQ==","shasum":"bcb9397bd637c4d2d727cf4a3bc5be28941f1189","tarball":"https://registry.npmjs.org/s-des-ts/-/s-des-ts-1.1.1.tgz","fileCount":28,"unpackedSize":37119,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9DqoL+4Rsb4G9ZOgp4JE9U+8DGgSJ9vl0wMhuVlGoOQIhANc/u9lFEINYP4WWVWsX9jQnMp4tPKV7NV0g7GWxpg2s"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN/RGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSZQ//TQJZLWSRVpSBjbYEUZ7R99CxE3KRgNR5FzFRE6ItQKxjRYTt\r\n+3fCF1bMwUkaEojs/X8muIqUPDOA2JRtEWjGR93i2h0FcAdqBAwZCRBm/5Gs\r\n8BmykYrlkL9Fj+2fmmEDxUD98VdPdkg8j7aOIOxpLQmXmr2MoSMntUKN7XHR\r\nr5AN8V74ze2sgT/p9wrofNbU3mOlss1qpDaqc1sYgKnUZSmSXDR7a9snricv\r\n58SfLMH78VP3/0WL/LUzT9GkQSo+rWPMJRIP1yrQXpNNSRhAyL785jhwSQTn\r\nSZo40A1w97669ENBOpx8K9rrzvs4ldHk0DbBLsTmBshxXZCxCBzpgIpDiNwP\r\nvcw5Cv1KpyjDJrKaFTdFzURoBczMBhP8HIAN+w7LM+0aEbmiV9SxETkcaQqa\r\n+tHqSv/I+d8ocDnHHwC7kfk5Ij/q4OQTKDA+NAWbWanXkR6+2ny9V56+ljkJ\r\nhdjqEXJDAgEJEJa/JHZE8Os7RG/yuQQrR4/PdssjyHEUplh9zxTbxy/6C4wJ\r\nkvaP96flhQFrU7915rcrjDatCfI5iqr4SKbXBbFg3jxJGFjwCDRTn9f2Zbi5\r\n9r8281jeV5mQpJ9urJgjfjzPGqEZJu9tfzNBTdtMSmQP1u2+ZoJD5EzVayea\r\nE+DQ65ucVjLEsW2N3RpVBxyGaW/ur8fIz+M=\r\n=Hn95\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"abtinokhovat","email":"abtinokhovat@gmail.com"},"directories":{},"maintainers":[{"name":"abtinokhovat","email":"abtinokhovat@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-des-ts_1.1.1_1681388614693_0.5759785101180099"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-09T11:31:51.885Z","1.0.0":"2023-04-09T11:31:52.108Z","modified":"2023-04-13T12:23:35.049Z","1.1.0":"2023-04-12T19:56:59.983Z","1.1.1":"2023-04-13T12:23:34.935Z"},"maintainers":[{"name":"abtinokhovat","email":"abtinokhovat@gmail.com"}],"description":"This packages has core functionalities for s-des encryption and decryption","keywords":["s-des","encryption","decryption"],"author":{"name":"Abtin Okhovat"},"license":"ISC","readme":"This library provides an implementation of the Simplified Data Encryption Standard (S-DES) algorithm. S-DES is a simplified version of the original Data Encryption Standard (DES) algorithm and is a lightweight encryption algorithm suitable for educational purposes and low-level security requirements.\n\n# S-DES Algorithm\nS-DES algorithm operates on 8-bit blocks of data and uses a 10-bit secret key. The algorithm consists of several rounds of Feistel cipher and uses simple substitution and permutation operations. More information about the S-DES algorithm can be found on the internet.\n\n# How to use the Cryptography class\nThe Cryptography class is the main class of this library and provides the following static methods:\n\n`GenerateKey(secret: number[]): number[]`: Generates a 10-bit secret key from a 10-bit secret. The secret parameter is an array of 10 bits (0 or 1).\n`Encrypt(plain: string, keys: Keys): BitBuffer`: Encrypts the given plain string using the provided `keys`. Returns a `BitBuffer` object containing the encrypted bits.\n`Decrypt(cipher: BitBuffer, keys: Keys): string`: Decrypts the given cipher `BitBuffer` using the provided `keys`. Returns the decrypted plain text string.\nExample\nHere's an example of how to use the Cryptography class:\n\n```javascript\nimport Cryptography from \"./class/Cryptography\";\n\nconst string = \"Hello,World but encrypted with s-des\";\nconst secret = [1, 0, 0, 0, 1, 0, 1, 1, 1, 0];\n\nconst keys = Cryptography.GenerateKey(secret);\nconst cipher = Cryptography.Encrypt(string, keys);\n\nconsole.log(`Cipher Bits:${cipher.toString()}`);\n\n// Cipher Bits: \n// 00010111-10101001-11011010-11011010-01100100-01101110-10000001-01100100-\n// 00011001-11011010-11100010-00110111-01111010-11010101-01110111-00110111-\n// 10101001-01111001-10001111-00011001-01101111-00010010-01110111-10101001-\n// 11100010-00110111-01101001-11000110-01110111-10111111-00110111-11101000-\n// 00010011-11100010-10101001-11101000\n\nconsole.log(`Cipher Ascii:${cipher.toAscii()}`);\n\n// Cipher Ascii:\n// ©ÚÚdn\u0000dÚâ7zÕw7©y\u0000ow©â7iÆw¿7èâ©è\n\nconst plain = Cryptography.Decrypt(cipher, keys);\n\nconsole.log(`Plain Text Decrypted:${plain}`);\n\n//Plain Text Decrypted:\n// Hello,World but encrypted with s-des\n\n```\n\nIn this example, we generate a 10-bit secret key from the secret array, encrypt the string using the generated keys, and then decrypt the cipher using the same keys. The output of this example will be the cipher bits, the cipher ASCII representation, and the plain text decrypted from the cipher.\n","readmeFilename":"README.md"}