This file contains hidden or 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; |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
This file contains hidden or 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
| import javax.crypto.KeyGenerator; | |
| import javax.crypto.SecretKey; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import javax.crypto.spec.IvParameterSpec; | |
| import java.security.MessageDigest; | |
| import java.security.spec.AlgorithmParameterSpec; | |
| import android.util.Base64; | |
| public class AESEnDecryption { |