My Hive Posts

    Read Encrypted Memo using Steem.js

    Steem allows you to send Encrpted message to everyone, and Steem.js already have built-in functions to encode and decode the memo.

    If you want to send an encrypted memo to any other people just append '# ' before your memo like below

    '# Testing is this is encrypted'

    In this tutorial, I will show how you can decrypt the memo send to you. If anyone has send you an encrypted message, the blockchain will show that message as shown below :

    image.png

    The code to decode the memo is using the function steem.memo.decode() where you have to pass the Memo Private Key as the first argument (memo private key can be of any one of the two i.e. sender or receiver) whereas the encoded message from the blockchain as the second argument as shown below -

    steem.memo.decode('Private Memo Key', '#AcWtdaiAKfHS5YkrJcFjtMMfFEzFn78AB23sbwt4TYWhMvevhV1F34hp7gjPDDgTKaaWWV6CnMYjr6ZWEEmMwbo4MpRM5huam9qUbXd9JjJf46uSwK9aRiy3u1s3K2H4DNzCuCopY1v3Yhcjp8r5Rt7')

    Once we run the above code after including the Memo Key, the decoded output is shown below :

    image.png

    Hope this tutorial is helpful if you would like to build your application and wanted to use Encryption of the memo and do not want people to read that memo instead of yourself or the one you have send the memo.



    Posted on Utopian.io - Rewarding Open Source Contributors