mirror of
https://github.com/OutCast3k/coinbin.git
synced 2025-12-30 13:46:55 +01:00
Added AES decryption to #sign
Added a passphrase input to #sign which allows you to enter an AES-256 encrypted key into the private key input if you chose, which will be decrypted using the passphrase.
This commit is contained in:
parent
c276998687
commit
2cd9465de9
@ -874,6 +874,10 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label for="signPrivateKeyPassphrase">Passphrase (optional)</label>
|
||||
<input id="signPrivateKeyPassphrase" type="password" class="form-control" value="">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
@ -1196,7 +1196,18 @@ $(document).ready(function() {
|
||||
|
||||
$("#signBtn").click(function(){
|
||||
var wifkey = $("#signPrivateKey");
|
||||
var passphrase = $("#signPrivateKeyPassphrase");
|
||||
var script = $("#signTransaction");
|
||||
|
||||
if(passphrase.val()!=""){
|
||||
var decrypted = CryptoJS.AES.decrypt(wifkey.val(), passphrase.val()).toString(CryptoJS.enc.Utf8);
|
||||
if(coinjs.addressDecode(decrypted)){
|
||||
$(passphrase).parent().removeClass('has-error');
|
||||
wifkey.val(decrypted);
|
||||
} else {
|
||||
$(passphrase).parent().addClass('has-error');
|
||||
}
|
||||
}
|
||||
|
||||
if(coinjs.addressDecode(wifkey.val())){
|
||||
$(wifkey).parent().removeClass('has-error');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user