This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Created by Awesometic | |
* references: https://gist.github.com/dealforest/1949873 | |
* This source is updated example code of above source code. | |
* I added it two functions that are make random IV and make random 256 bit key. | |
* It's encrypt returns Base64 encoded cipher, and also decrpyt for Base64 encoded Cipher | |
*/ | |
import android.util.Base64; | |
import javax.crypto.BadPaddingException; | |
import javax.crypto.Cipher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Awesometic | |
* It's encrypt returns Base64 encoded, and also decrypt for Base64 encoded cipher | |
* references: http://stackoverflow.com/questions/12471999/rsa-encryption-decryption-in-android | |
*/ | |
import android.util.Base64; | |
import java.nio.charset.StandardCharsets; | |
import java.security.InvalidKeyException; | |
import java.security.KeyFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Awesometic | |
* references: https://gist.github.com/ericchen/3081970 | |
* This source is updated example code of above source code. | |
* I added it two functions that are make random IV and make random 256 bit key. | |
* It's encrypt returns Base64 encoded cipher, and also decrpyt for Base64 encoded Cipher | |
*/ | |
var crypto = require('crypto'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Awesometic | |
* references: https://github.com/rzcoder/node-rsa | |
* RSA encryption example for Node.js with node-rsa. It's encrpyt returns Base64 encoded cipher, also decrypt for Base64 encoded cipher. RSA public key be returned in PKCS8 format. | |
* License for node-rsa | |
Copyright (c) 2014 rzcoder<br/> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |