<center>![Hivecrypt thumbnail.png](https://ipfs.io/ipfs/QmZ44f49mDr746uqisE11de6WXa3ojka4oecYTsvTo6BNb)</center> Are you getting the following error message when trying to encrypt or decrypt a Steem memo in ElectronJS or React Native using [steem-js](https://github.com/steemit/steem-js)? Perhaps looking for something that works for your framework that you're using when building your cutting-edge Steem DApp? <center>![Screenshot 20201122 at 12.04.23 PM.png](https://files.peakd.com/file/peakd-hive/techcoderx/kpahmLHh-Screenshot202020-11-2220at2012.04.2320PM.png)</center> Introducing [Hivecrypt](https://github.com/techcoderx/hivecrypt), a module that you can import into a wide range of JavaScript environments, including desktop and mobile app frameworks like ElectronJS, that wouldn't otherwise work with existing libraries. Adapted from this [pull request](https://peakd.com/hive-139531/@tngflx/contribution-to-dhive-added-memo-encryption-and-decrypt-feature) on [dhive](https://gitlab.syncad.com/hive/dhive) that was never merged into `master` (plus the major help from this [file](https://github.com/mahdiyari/hive-tx-js/blob/master/helpers/crypto.js)), Hivecrypt was built on [Crypto-JS](https://github.com/brix/crypto-js) that works on virtually any latest JavaScript environments, unlike the implementation on [steem-js](https://github.com/steemit/steem-js) and the pull request mentioned above, that uses the [crypto](https://nodejs.org/api/crypto.html) NodeJS module that only works on certain environments. ## How to use? Hivecrypt can be installed from `npm` with the following command: ``` npm i hivecrypt ``` It can also be imported into the browser by including the following script tag in your HTML file, where Hivecrypt will be available through `window.hivecrypt`: ``` <script src="https://unpkg.com/hivecrypt/bin/hivecrypt.min.js"></script> ``` Once installed, it may be used for encrypting and decrypting memos just like how it is done with [steem-js](https://github.com/steemit/steem-js), but works in more environments. ``` const hivecrypt = require('hivecrypt') // CommonJS let encrypted = hivecrypt.encode('privatekey1','publickey2','#somesecretmessage') let decrypted = hivecrypt.decode('privatekey2',encrypted) console.log(encrypted,decrypted) ``` It might not be built with optimizing for the smallest package size in mind, but at least it is something that is usable for devs. And yes, it was originally written for Hive but works for any 3 character public key prefixes.
post_id | 88,514,474 |
---|---|
author | techcoderx |
permlink | hivecrypt-javascript-module-for-steem-memo-encrypt-decrypt-on-wide-range-of-environments |
category | encryption |
json_metadata | {"app":"steempeak\/2020.07.1","format":"markdown","tags":["encryption","decryption","dev","memo","nodejs","javascript","hivecrypt","crypto","hive"],"users":["tngflx"],"links":["https:\/\/github.com\/steemit\/steem-js","https:\/\/github.com\/techcoderx\/hivecrypt","https:\/\/peakd.com\/hive-139531\/@tngflx\/contribution-to-dhive-added-memo-encryption-and-decrypt-feature","https:\/\/gitlab.syncad.com\/hive\/dhive","https:\/\/github.com\/mahdiyari\/hive-tx-js\/blob\/master\/helpers\/crypto.js","https:\/\/github.com\/brix\/crypto-js","https:\/\/github.com\/steemit\/steem-js","https:\/\/nodejs.org\/api\/crypto.html","https:\/\/github.com\/steemit\/steem-js"],"image":["https:\/\/ipfs.io\/ipfs\/QmZ44f49mDr746uqisE11de6WXa3ojka4oecYTsvTo6BNb","https:\/\/files.peakd.com\/file\/peakd-hive\/techcoderx\/kpahmLHh-Screenshot202020-11-2220at2012.04.2320PM.png"]} |
created | 2020-11-22 13:30:09 |
last_update | 2020-11-22 13:30:42 |
depth | 0 |
children | 0 |
net_rshares | 457,571,508,423 |
last_payout | 2020-11-29 13:30:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.048 SBD |
curator_payout_value | 0.047 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 2,514 |
author_reputation | 27,683,578,118,267 |
root_title | " Hivecrypt: JavaScript module for Steem memo encrypt/decrypt on wide range of environments" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
xr-hammergaming | 0 | 2,753,036,834 | 100% | ||
emjoe | 0 | 2,721,146,018 | 38.5% | ||
d00k13 | 0 | 5,945,962,877 | 69.3% | ||
sbi2 | 0 | 404,032,052,835 | 91.49% | ||
techcoderx | 0 | 1,444,612,814 | 100% | ||
brettblue | 0 | 1,329,511,545 | 77% | ||
onelovedtube | 0 | 35,978,116,720 | 77% | ||
moirailia | 0 | 75,807,618 | 38.5% | ||
onelove.curation | 0 | 830,460,687 | 77% | ||
onelovecuration | 0 | 911,223,762 | 77% | ||
onelovestee | 0 | 147,708,488 | 100% | ||
n00k13 | 0 | 85,897,578 | 100% | ||
r00k13 | 0 | 197,603,933 | 38.5% | ||
scaredybear | 0 | 137,675,509 | 38.5% | ||
w00k13 | 0 | 145,800,330 | 38.5% | ||
l00k13 | 0 | 144,318,563 | 38.5% | ||
c00k13 | 0 | 154,533,418 | 38.5% | ||
s00k13 | 0 | 143,198,886 | 38.5% | ||
ctp00k13 | 0 | 141,078,179 | 38.5% | ||
moon-stone | 0 | 47,755,175 | 38.5% | ||
red-cross | 0 | 126,056,398 | 34.65% | ||
miguelwalter | 0 | 77,950,256 | 38.5% |