Skip to content

Instantly share code, notes, and snippets.

View mage1k99's full-sized avatar
🏠
Working from home

Magesh Babu mage1k99

🏠
Working from home
View GitHub Profile
@mage1k99
mage1k99 / Cipherinit.java
Last active May 26, 2019 12:23
Causes Error
private boolean cipherinitalize() {
try {
cipherObject = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_CBC + "/" + KeyProperties.ENCRYPTION_PADDING_PKCS7);
keyStoreObject.load(null);
SecretKey secretKeyObject = (SecretKey) keyStoreObject.getKey(key_name,null);
cipherObject.init(Cipher.ENCRYPT_MODE, secretKeyObject);
return true;
} catch (IOException e) {
e.printStackTrace();
Log.e(TAG, "cipherinitalize: IOException error Occared", e);
@mage1k99
mage1k99 / Error.log
Created May 26, 2019 12:17
Error Log generated by the method
2019-05-26 17:26:37.712 18345-18345/xo.chilout.justtry E/FirstThird Activity: cipherinitalize: InvalidKeyException
java.security.InvalidKeyException: Only SecretKey is supported
at com.android.org.conscrypt.OpenSSLCipher.checkAndSetEncodedKey(OpenSSLCipher.java:462)
at com.android.org.conscrypt.OpenSSLCipher.engineInit(OpenSSLCipher.java:284)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2984)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2891)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2796)
at javax.crypto.Cipher.chooseProvider(Cipher.java:773)
at javax.crypto.Cipher.init(Cipher.java:1143)
at javax.crypto.Cipher.init(Cipher.java:1084)
@mage1k99
mage1k99 / FingerprintHandler.java
Created May 26, 2019 12:27
The Full Code for fingerprint
package xo.chilout.justtry.fingerprint;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.hardware.fingerprint.FingerprintManagerCompat;
import android.support.v4.os.CancellationSignal;
import android.widget.Toast;
@mage1k99
mage1k99 / .bashrc
Created April 24, 2020 10:03
PopOS! bashrc with parrot style terminal
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# Xx_69pussy_slayer420_xX
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@mage1k99
mage1k99 / regex
Created June 30, 2020 09:50
Collections of Regex, that i found useful, as I find , I'll update this Gist.
Find unwanted empty lines, can be used with find and replace to remove unwanted empty lines
^(?:[\t ]*(?:\r?\n|\r))+
#!/bin/bash
siteDir="/var/www/$1"
echo 'Creating directory at /var/www/ for '$1''
mkdir -p $siteDir
echo 'Directory created '$siteDir' '
echo "changing ownership of directory"
chown www-data:www-data $siteDir -Rv
echo "creating an index.html file"
@mage1k99
mage1k99 / Generate GPG Key
Last active December 28, 2020 21:28
generate gpg key, for my medium article
gpg --full-gen-key
@mage1k99
mage1k99 / Listing GPG Keys
Created December 28, 2020 21:30
Command to List the GPG Keys
gpg --list-secret-keys --keyid-format LONG
@mage1k99
mage1k99 / Telling about GPG Keys to Git
Created December 28, 2020 21:34
The list of commands that says git to use the GPG Key
git config --global user.signingkey ED267DF4249ACCC3
git config --global gpg.program (which gpg)
git config --global commit.gpgsign true
@mage1k99
mage1k99 / set value of GPG_TTY in fishShell
Created December 28, 2020 21:37
Command to set the value of GPG_TTY value in fish
set -gx GPG_TTY (tty)