Hi,

I need to use a private key to cipher messages, but I need to do it with
the user's interaction (I need to take the password from the user), and I
can't have a decripted key in memory.

I can only see the "decrypt" method, but when I finish using the key, I
need to deallocate it.

I think on a factory, cloning the original key:

getPrivateKey(password) {
    var key = {};
    _.extend(key, this._privateKey);

    if (!key.decrypt(password))
        throw new Error ("Bad password");

    return key;
}

But, I don't know if it's the properly way to do it.

Btw, I'd like to know if there is something more efective, for ex: nullify
the content on RAM, or something like this.

Thanks.

-- 
Exos ~  (>‿◠)✌
Linked'in: http://www.linkedin.com/in/ogexos
Twitter: @exos, Indeti.ca: @exos
Cel:  [+54 9 11] 6133-2442

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d-- s++:* a- C+++$ UBL+++$ P(-) L+++$ !E--- W+++$ !N !o K-? !w--- !O
!M-- V? PS+++@ !PE Y+(++) PGP++ !t--- !5 X++ R(+) tv--(!) b- DI D-- G e@
h>++ r--- y*>+++++
------END GEEK CODE BLOCK------
_______________________________________________

http://openpgpjs.org
Subscribe/unsubscribe: http://list.openpgpjs.org

Reply via email to