Académique Documents
Professionnel Documents
Culture Documents
Service
…………………………………
…………………………….
sendOtpForEncryption(phone: string) {
headers.append('Content-Type', 'application/json');
.map(response => {
response.json();
});
decrypted_text : string;
this.encrypted_text = '';
……………………………………….
………………………………………
keySize: this.keySize/32,
iterations: this.iterations
});
let iv = CryptoJS.lib.WordArray.random(128/8);
iv: iv,
padding: CryptoJS.pad.Pkcs7,
mode: CryptoJS.mode.CBC
});
this.encrypted_text = transitmessage;
console.log('encrypted_text',this.encrypted_text);
return Observable.of({'encrypted_text':this.encrypted_text});
}
HTML
buy-sell.component.html
privateKey
<div class="form-group">
</div>
Submit button
</div>
buy-sell.component.js
sendOtpForEncryption() {
this.userService.sendOtpForEncryption(phone).subscribe(data => {
console.log('sendOtpForEncryption===>>>', data);
});
}
// function added by @abdul
getEncypted(message:string, password:string) {
this.commonService.getEncrypt(message,password).subscribe(data => {
this.encrypted_text = data.encrypted_text;
});