Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1019601 // rsaEncrypt - only takes short data (like a symmetric key)

JavaX fragment (include)

import javax.crypto.Cipher;

// Encrypt using RSA private key
sS rsaEncrypt(S plainText, PrivateKey privateKey) ctex {
  Cipher cipher = Cipher.getInstance("RSA");
  cipher.init(Cipher.ENCRYPT_MODE, privateKey);
  ret base64(cipher.doFinal(toUtf8(plainText));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019601
Snippet name: rsaEncrypt - only takes short data (like a symmetric key)
Eternal ID of this version: #1019601/3
Text MD5: a902f085ddf253f8c95580d5d3fc18fe
Author: stefan
Category: javax / encryption
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-14 00:11:30
Source code size: 268 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 330 / 359
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1019603 - rsaDecrypt