Showing posts with label encryption. Show all posts
Showing posts with label encryption. Show all posts

20 June 2018

Tandatangan Digital



Digital Signing guna asymetric keys(private/public key)

Penghantar:
1- hantar dokumen asal dan digest yg telah diencryptkan.


Penerima:
2- hashkan dokumen utk hasilkan digest.
3- decryptkan(guna public key penghantar)  'encrypted digest'.
4- bandingkan 2 dan 3, jika sama, sah.


Teknologi Priviate/Public key:
- Jika encrypt guna PrivateKey, hanya PublicKey yg boleh decrypt.
- Jika encrypt guna PublicKey, hanya PrivateKey yg boleh decrypt.
(Hebatankan Matematik..)





ref: https://www.youtube.com/watch?v=_8M_vuFcdZU (3:31)

18 June 2015

Cryptography

Key Type

  • Symmetric
    • same key to encrypt/decrypt
    • fast
    • Algorithms:
      • DES
      • 3DES
      • Blowfish
      • RC4, RC5, RC6
      • AES
  • Asymmetric
    • slow
    • public key
      • to encrypt
      • share to others/world
    • private key
      • to decrypt
      • keep by owner
    • Algorithms:
      • RSA
      • ECC
      • Diffie-Hellman
      • El Gamal
      • DSA


Methods Of Encryption
  • Block Cipher
    • use symmetric encryption
    • fix-length
      • pad added to short blocks

  • Stream Cipher
    • use symmetric encryption
    • 1 bit/byte at a time
    • should use different IV
  • Attributes
    • Confusion
      • cant determine the key based on ciphertext(encrypted data)
    • Diffusion
      • 1 change in plain text would output result at least 50% diff



Block Mode 


  • Mode is needed when data is larger than block size
  • Modes
    • ECB - Electronic Code Block
      • Weak
        • same chipher text for same block
          • refer https://www.youtube.com/watch?v=uPiqyQOMH1E , at 1:05
          • https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#/media/File:ECB_encryption.svg
    • CBC - Cipher Block Chaining
      • has additional parameter
        • use IV for first block
        • use ciphertext for the next block
      • usually just XOR the block with the extra param before encrypt using the key
      • ref: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#/media/File:CBC_decryption.svg
    • CFB - Cipher Feedback
    • OFB - Output Feedback
    • CTR - Counter
Types of Symmetric

04 June 2015

steghide (stegonography)

tools: steghide:



ref:
1) http://steghide.sourceforge.net/documentation/manpage.php

12 September 2013

truecrypt

http://ubuntuhandbook.org/index.php/2013/08/install-truecrypt-with-indicator-ubuntu-1304/

INSTALL
1) sudo add-apt-repository ppa:stefansundin/truecrypt
2) sudo apt-get update; sudo apt-get install truecrypt




REMOVE
sudo apt-get remove truecrypt 
sudo apt-add-repository --remove ppa:stefansundin/truecrypt 
sudo apt-get update

27 May 2013

tipu helai gpg

senarai public keys:
  gpg --list-keys

senarai private keys:
  gpg --list-secret-keys

decrypt file:
  gpg -o outputfile -d myencrypted.file.asc

ref>>  http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/

------------------------

to import a public key:
gpg --import public.key

This adds the public key in the file "public.key" to your public key ring.

to import a private key:
gpg --allow-secret-key-import --import private.key

This adds the private key in the file "private.key" to your private key ring. There's a note (*) at the bottom explaining why you may want to do this.

to delete a public key (from your public key ring):
gpg --delete-key "User Name"
This removes the public key from your public key ring.
NOTE! If there is a private key on your private key ring associated with this public key, you will get an error! You must delete your private key for this key pair from your private key ring first.

to delete an private key (a key on your private key ring):
gpg --delete-secret-key "User Name"
This deletes the secret key from your secret key ring.

To list the keys in your public key ring:
gpg --list-keys


To list the keys in your secret key ring:
gpg --list-secret-keys


To generate a short list of numbers that you can use via an alternative method to verify a public key, use:
gpg --fingerprint > fingerprint
This creates the file fingerprint with your fingerprint info.

22 November 2012

CSR Certificate Signing Request

Permohonan utk Sign Certificate



following steps found at:
        https://devcenter.heroku.com/articles/csr

1) creating private key
        openssl genrsa -des3 -out server.orig.key 2048
2) creating passphrase-less key
        openssl rsa -in server.orig.key -out server.key
3) generate csr(certificate signing request)
        openssl req -new -key server.key -out server.csr

additional:

to generate public key from the private key
        openssl rsa -in server.orig.key -pubout > server.orig.key.pub

01 November 2012

encrypt: loop file


LOOP TUTORIAL
loop tutorial at http://www.saout.de/tikiwiki/tiki-index.php?page=looptutorial

Setting the Loop File
        1>      dd if=/dev/urandom of=/home/secret bs=1M count=100
        2>      losetup /dev/loop0 /home/secret
        3>      modprobe dm_crypt
        4>      cryptsetup -c aes -y create secret /dev/loop0
        5>      mke2fs -j /dev/mapper/secret     (ext3)
        5>      mke2fs -t ext4 -j /dev/mapper/secret     (ext3)
        6>      mount /dev/mapper/secret /mnt/secret