Skip to content

Instantly share code, notes, and snippets.

Jordan Baucke jordanbaucke

Block or report user

Report or block jordanbaucke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View nuts_and_bolts_match.js
let nuts = ['@', '#', '$', '%', '^', '&']
let bolts = ['$', '%', '&', '^', '@', '#']
View addprovider.java
// add Bouncy JCE Provider, http://bouncycastle.org/latest_releases.html
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
View pseudo.java
string signature = generatePGPSignature(message, privKey);
View unlocksecretkey.java
string pass = "hongkong";
PGPPrivateKey pgpPrivKey = pgpSec
.extractPrivateKey(new JcePBESecretKeyDecryptorBuilder()
.setProvider("BC").build(pass.toCharArray()));
View readprivatekey.java
public static PGPSecretKey readSecretKey(InputStream input) throws IOException, PGPException {
PGPSecretKeyRingCollection pgpSec = new PGPSecretKeyRingCollection(
PGPUtil.getDecoderStream(input));
Iterator keyRingIter = pgpSec.getKeyRings();
while (keyRingIter.hasNext()) {
PGPSecretKeyRing keyRing = (PGPSecretKeyRing) keyRingIter.next();
Iterator keyIter = keyRing.getSecretKeys();
while (keyIter.hasNext()) {
View readpublickey.java
public static PGPPublicKey readPublicKey(InputStream input) throws IOException, PGPException {
PGPPublicKeyRingCollection pgpPub = new PGPPublicKeyRingCollection(
PGPUtil.getDecoderStream(input));
Iterator keyRingIter = pgpPub.getKeyRings();
while (keyRingIter.hasNext()) {
PGPPublicKeyRing keyRing = (PGPPublicKeyRing) keyRingIter.next();
Iterator keyIter = keyRing.getPublicKeys();
while (keyIter.hasNext()) {
View addprovider.java
String privateKeyPassword = "hongkong";
PGPPrivateKey pgpPrivKey = pgpSec
.extractPrivateKey(new JcePBESecretKeyDecryptorBuilder()
.setProvider("BC").build(privateKeyPassword.toCharArray()));
View signmessage.java
private static String signMessageByteArray(String message,
PGPSecretKey pgpSec, char pass[]) throws IOException,
NoSuchAlgorithmException, NoSuchProviderException, PGPException,
SignatureException {
byte[] messageCharArray = message.getBytes();
ByteArrayOutputStream encOut = new ByteArrayOutputStream();
OutputStream out = encOut;
out = new ArmoredOutputStream(out);
View encryptstring.java
public static String encryptByteArray(byte[] clearData,
PGPPublicKey encKey, boolean withIntegrityCheck, boolean armor)
throws IOException, PGPException, NoSuchProviderException {
ByteArrayOutputStream encOut = new ByteArrayOutputStream();
OutputStream out = encOut;
if (armor) {
out = new ArmoredOutputStream(out);
}
View keybase.md

Keybase proof

I hereby claim:

  • I am jordanbaucke on github.
  • I am jordanbaucke (https://keybase.io/jordanbaucke) on keybase.
  • I have a public key whose fingerprint is 08CC 4540 252F 0CC7 C8BA 6E17 3FD6 CF71 5477 03B0

To claim this, I am signing this object:

You can’t perform that action at this time.