Skip to content

Instantly share code, notes, and snippets.

@tryprasannan
tryprasannan / _openssl-aes-encryption-cmd.md
Last active October 2, 2020 16:27
Encrypt & Decrypt message with AES using OpenSSL

Requires OpenSSL version 1.1.1

Encrypt

$ echo -n "message to encrypt"| openssl enc -e -aes-256-ctr -nopad -base64 -pbkdf2 -iter 99999 -k secret -S 9876598765
U2FsdGVkX1+YdlmHZQAAANi/ijMqF9vFCC9lCzdkBNNBTg==

Decrypt

$ echo "U2FsdGVkX1+YdlmHZQAAANi/ijMqF9vFCC9lCzdkBNNBTG==" | openssl enc -d -aes-256-ctr -nopad -base64 -pbkdf2 -iter 99999 -k secret -S 9876598765
@tryprasannan
tryprasannan / app_build.gradle
Last active September 27, 2016 14:04
Propogate BuildTypes to dependant modules in android gradle plugin
dependencies {
releaseCompile project(path: ':library_module', configuration: 'release') // Build release version of lib when building release version of app
debugCompile project(path: ':library_module', configuration: 'debug') // Build debug version of lib when building debug version of app
}
@tryprasannan
tryprasannan / CheatSheet.java
Created November 23, 2012 17:17 — forked from romannurik/CheatSheet.java
Android helper class for showing cheat sheets (tooltips) for icon-only UI elements on long-press. This is already default platform behavior for icon-only action bar items and tabs. This class provides this behavior for any other such UI element.
/*
* Copyright 2012 Roman Nurik
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tryprasannan
tryprasannan / LicensesActivity.java
Created November 21, 2012 15:20 — forked from cyrilmottier/LicensesActivity.java
"Open source licenses" screen
package com.cyrilmottier.android.citybikes;
import android.os.Bundle;
import com.cyrilmottier.android.avelov.R;
import com.cyrilmottier.android.citybikes.app.BaseActivity;
public class LicensesActivity extends BaseActivity {
private WebView mWebView;