Tag: encrypt

Encryption, Privacy, Security, Truecrypt

How to Encrypt Files/Folders using TrueCrypt

TrueCrypt is software for establishing and maintaining an on-the-fly-encrypted volume (data storage device). On-the-fly encryption means that data is automatically encrypted right before it is saved and decrypted right after it is loaded, without any user intervention. No data stored on an encrypted volume can be read (decrypted) without using the correct password/keyfile(s) or correct …

Microsoft Windows, Security, SSH, Tunneling

Encrypt your internet traffic in Windows via SSH Tunnel

1. Download and install Cygwin – http://www.cygwin.com/ 2. Install Openssh and Vim packets. 3. Open the Cygwin terminal. 4. Type: vim tunnel.shvim tunnel.sh 5. Write in file the following line: ssh -x -2 -D 1919 [username]@[ipaddress-or-hostname]ssh -x -2 -D 1919 [username]@[ipaddress-or-hostname] 6. Exit vim. 7. Type: chmod u+x tunnel.shchmod u+x tunnel.sh to make the script …

Cryptography, General, Security Software

TrueCrypt | Disk Encryption

TrueCrypt is an open-source and cross-platform disk encryption software. It works on Windows 7/Vista/XP, Mac OS X, and Linux. It is also available as stand alone executable. It establishes and maintains an on-the-fly-encrypted volume (data storage device). On-the-fly encryption means that data is automatically encrypted right before it is saved and decrypted right after it is loaded, …

Java

Encrypt string using AES 128 – Java

You need Apache Commons Codec. package encryption.aes;   import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64;   public class aes128 {   public static void main(String args[]) { String plain = "testtesttesttesttesttesttesttest"; String ivkey = "abcdefgh12345678";   byte[] ivraw = ivkey.getBytes(); SecretKeySpec skeySpec = new SecretKeySpec(ivraw, "AES"); …

Email

How to send encrypted emails

We are going to see how we can send encrypted emails using thunderbird, Enigmail and OpenPGP standard. 1. Download & Install GnuPG. You will find it here or sudo apt-get install gnupg for ubuntu users. 2. Download & Install Thunderbird. You will find it here or sudo apt-get install thunderbird for ubuntu users. 3. Download …

PHP, WEB

How to secure passwords in PHP

We are going to use sha1 algorithm(build-in php function), md5 algorithm(build-in php function) and salt to secure the password.   1 2 3 4 5 function securePassword($plaintext) { $salt = substr(md5(uniqid(rand(), true)), 0, 8); return sha1($salt . sha1($salt . $plaintext)); }function securePassword($plaintext) { $salt = substr(md5(uniqid(rand(), true)), 0, 8); return sha1($salt . sha1($salt . $plaintext)); …

C#, Microsoft Windows

Hashing text with SHA-256 in C#

A simple c# method to produce hashes from plain text using SHA-256 algorithm in visual c#! 1 2 3 4 5 6 public String Hash_SHA256(String plainText) {             byte[] inputBytes = Encoding.UTF8.GetBytes(plainText);             byte[] hashedBytes = (new SHA256CryptoServiceProvider()).ComputeHash(inputBytes);             return BitConverter.ToString(hashedBytes).Replace("-", string.Empty).ToLower(); }public String Hash_SHA256(String plainText) {             byte[] inputBytes = Encoding.UTF8.GetBytes(plainText);             byte[] hashedBytes …