KA MU THEI LO - PART TWO

Zan 5 zawn zet chu ka mu ta lo chu a ni a; han sawi chiam lah hi a nuam thin si lo! A hrehawm em em phei chu a ni hran lo.

Ka Mu Thei Lo series hi ka mut theih loh apiang in ziak dawn ila chuan part 50 vel dawn chu ziah tur a awm tawh awm e.

Insomnia an tih natna hi ka nei a ni thei mai ang em? :)

He natna hi eng vang a awm thei nge tih Google ah ka han zawng chhin a. Sleepfoundation.org ah hian tha deuh pakhat chu ka hmu a. Ka chhiar thuak thuak a. A thlen theitu awm ang a an sawi ho hi ka nihna a ni em em hran si lo. Taksa lam harsatna leh damlohna ka nei lo. Rilru lam ah lah ni se, mi thawveng ru ve zek chi hi ka ni bawk si. A rukin, kei pawhin a ka hriat loh hian depression ka lo nei reng te hi a ni mai ang a. Hahaha... !

Tension erawh chu a sang ve ang reng a; hna ka ngah a, hun ka nei tlem a ka thatchhe tel bawk! Chuvang chuan tension chu a awm ve reng. Mahse, rilru hah phah em em na chhan tur erawh kei chuan a tling in ka hre lo.

Eng pawh ni se, hei zing lam dar 3:14 chu a ni leh ta reng mai chu a ni a. Vawiin lamah ka ATM card lam ngei ngei ka ngai tawh bawk. Ka lam na tur hmun , Mukundapur hi a hming ka hriat vawi khatna a ni a, ka va bo em lo tur ah ngai ang.

SBI ho hi ka ATM card thar ka siam tir hi RuPay in an lo siam a ni awm a. Ka duh lo viau asin maw le! Online a hman a har lutuk hi a buaithlak. An employee te biak an har tel leh zel bawk nen, Bank hran a account siam tir mai hi a ngai dawn a ni! :)

Hui hammm...! Sava an chiap leh ta nak nak mai! Tui deuha mut hilh burh burh ka va chak em! Mut tlem vang lah hian ka cher phah ve chuang bawk si lo! Naktuk zan chu mut luih tum ila a tha ang.

Mak deuh ka tih pakhat chu... He lai M.Tech zirlai ho hi an mu tam bik lo nge ni? Dar 2 - 3 AM vel hian ka room hnuai chiah ep zawl ah hian Badminton an rawn khel ziah mai a. A changin dar 12 - 1 AM vel te... an bengchheng em em hran chuang lem lo va. Engati nge maw ni aw...ka lo ti ve mai mai thin! India zawng maksak pui pui kan lo tam a ni e.

Awwlllrait.... duh tawk mai ang. Thui deuh ziah zawng a nin awm duh.
Share:

INDOCRYPT 2016

On 11th December, 2016, around 70 (not sure) Authors and Delegates gather at the Auditorium of Indian Statistical Institute, Kolkata. I was very happy and felt proud to be one of them. Mathematicians, Computer Scientists and Programmers gather because of no other reason, but because of Indocrypt 2016, one of the most valued Cryptography Conference in India.

The credit of me being able to attend such an important conference goes to Dr. Goutam Kumar Paul. He was my guide. my caretaker and my friend. He was a very open and normal person, he never put himself above others. But still, he was one of the most respectful person I've ever met in my academic life.

So sad that I have no camera device to capture the wonderful moments.I try to attached some if I can get some from other delegates. :D

The first day ( 11/12/2016, Sunday) was Tutorials session, given by Orr Dunkelman and Claudio Orlandi. Most of the delegates reached on this day only and of course felt tired. That is why the auditorium (conference hall) was very quiet (some fo us are snoring... :D  zzzzz).

Blog hi formal deuh hian ka ziak thiam ngang lo ani e. Mizo tawng tlem kan zep tel leh zeuh ang a; Chawchhun kan han ei a, buh pangngai (steam rice) , arsa kan, dailuah kan, fanghma leh purun sen zai lep, alu kan ro an lo buatsaih a. Ceramic plate ah fiante leh fork nen kan han ti ve a. Ka ei tui thei ngang lo a. Han bar mawlh mawlh mai ka chak viau na in ka bar ngam ngang lo a ni e. Ka lanmawi duh vangin ka puar loh phah chu a ni mai awm e. Han bar puk puk ila ka lang mawi lo awm chuang der si lo ila! :D 

The lunch was a perfect one except I dare not to dig in with my bare hand, which was my tradition (digging in with bare hand). Shame on me!

The conference (paper presentation) starts on the second day, with invited talk between 2-3 presentations. The conference was maintaining a proper schedule with a correct timing. The paper presentation continues on the 3rd day and the banquet was held in Bengal Club, Kolkata on this evening, which I did not attend as I am having some other Internship-related work which I continued till the next morning (yeah, didn't sleep!)

I went to my hostel room at around 7 in the morning, change my clothes and sleep for 4 hours, took bath and headed of for Indocrypt which was about to start their lunch. Perfect timing!!! I wish I could take the picture of us having lunch under the coconut trees.

As I was saying in the previous post, I have no deep knowledge about Cryptography at all. Because of this, the conference was not a good experience academically, but it was a very very good experience in general! The delegates and authors are one of the most friendly  people I've met.

Lastly, I'll try to attached some appropriate photos if I can get them. And thanks again to my Professor Dr Paul. (even though the chance of him seeing this post is very less!). Thank you Sir! :D :D
Share:

HELLO CRYPTOGRAPHY!

I should say this is not my first time in Kolkata because I've been inside the Netaji Shubash Chandra Bose International Airport for like five hours waiting for a delayed flight to New Delhi! 😁 !

But, formally, this is my first time in Kolkata.

I got this precious opportunity to do a research internship under Dr. Goutam Paul at RC Bose Center for Cryptography and Security, ISI Kolkata.

I love the hospitality they give here except the Internet connection! It is f**ckin' slow!

At first, I thought I'm going to write about my life here, but as I have no camera to take the photos of me and the surroundings, I think I should wait until I can get a new phone (camera).

So, I will write a short post about my first task here.

I should say I am completely new to Cryptography. But I am having some basic knowledge of graph in Mathematics. Hope I can get through this!  💪 !

Actually, my first task that my guide gave me was a very very simple thing.

He has a GPU machine in his office  NVIDIA Quadro K4000 3GB. He wants some of his colleagues to be able to access this machine from their own computer.

So, basically, my task was that I have to set up a centralized GPU server.
More technically, I have to set up a simple SSH server in the machine (which runs on Ubuntu 16.04 Xenial Xerrus).

So, all I have to do is to just install openssh-server on the system as;
sudo apt-get install openssh-server

I don't know why he let me do this! But, everything is fine.

The second task is to study CUDA programming for GPU.
Honestly, this is the first time I heard the word CUDA! WOW! It's going to be a long winter!
He gave me one PDF tutorial on CUDA and I have to do everything else.
Till now, nothing is related much to cryptography.

Last night i.e. 6th Dec 2016, I got an email from him about a new task/assignment. He attached a paper  "Optimal Listing of Cycles and st-Paths in Undirected Graphs"! My new task was to implement the algorithm they mentioned in the paper. Now this is related to Cryptography in some way. I spend the whole night studying the paper, which, until now, brought me nothing! This is surely going to be a long winter. A long one.

I should say I hate Algorithm (Mathematics), but I want to pursue a career on it.

Honestly, I wish I could turn back time and give more attention to Sir Gautam Majumder's Algorithm class! 😓!

Oh Graph , I hate you!

But, let's see! I hope that I could solve the thing.

Talking about cryptography, I never knew that graph and this encryption thing will co-relate. I have heard of classical encryption like a monoalphabetic encryption. But honestly, I  never thought that Cryptography will be so complex like this.

A very common classical encryption technique was this monoalphabetic transpositional encryption.
The below C program shown is the application of this technique.

encrypt.c


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <string.h>

void encrypt(char password[],int key)
{
    unsigned int i;
    FILE *fptr;

    for(i=0;i<strlen(password);++i)
    {
        password[i] = password[i] - key;
    }

    fptr = fopen("code", "w");


    fprintf(fptr, "%s", password);

}

int main()
{
    char password[20];
    printf("Enter password\n");
    scanf("%s", password);
    encrypt(password,1);
    printf("Encrypted value = %s\n",password);

    return 0;
}


The encrypt.c will take a plaintext input and will encrypt it by changing its character with its predecessor i.e. s will be replaced by r, T will be replaced by S, and so on. This is because I choose the key as "1". You can change the key as you like it, but the key should be remembered as it is also going to be used for decryption The code will write the encrypted text i.e. the cyphertext to a file "code ", which will be passed as a message to another person.

The person who received the ciphertext can decrypt the code by the below C program.

decrypt.c


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <string.h>


void decrypt(char password[],int key)
{


    unsigned int i;
    for(i=0;i<strlen(password);++i)
    {
        password[i] = password[i] + key;
    }


}
int main()
{
    char password[20];
    printf("Enter the encrypted code!\n");
    scanf("%s", password);

    decrypt(password,1);
    printf("Decrypted value = %s\n",password);
    return 0;
}


The second person will enter the ciphertext and using the key "1", he will be able to decrypt it easily and it will show the exact plaintext that the sender encrypted.

This is one of the oldest and simplest encryption technique. If the key is found out by "a man in the middle", it can be easily cracked. Because of this, this encryption technique is not used nowadays. But still,  it was a fun thing to do and looks cool sharing with friends

Try the above simple code. If there is anythig wrong, please comment.

Share:

THAT VULNERABILITY : MIZOSTORE.COM

Well, I don't mean to hack it. But, only a little curiosity is needed for this hack. So, I can't resist the offer from Mizostore.com .

This time I'm gonna mixed this article with Mizo language so that more people can understand!

Mizostore.com te hian an security hi lo ngai pawimawh deuh se ka duh vang chauh a ni!

They are responsible for handling the works of Mizo artiste who trust them to handle their work.

Sumdawnna atana an tih ngawr ngawr erawh chu a la ni lo mai thei. Mizo ten hla kan inpekchhawn dan ah hma kan sawn zel theih nan a an hla te online a zuar mai chauh an nih hlawm ka ring a. Mizostore.com a hla upload tu te ka en hian he website a hla upload/zawrh a innghat an awm chu ka ring chiah lo a. Chuvangin Website siam tu te lam in siamthat nan a he post hi ziak ka ni.

Hope they could fix this! :D :D

Blue Wave Records lamin "Ka zei an ti" tih hla kha Mizostore.com ah a lei theih dawn tih an tarlan ka lo hmu ve a. Mizostore.com chu ka han enchiang a. Web Developer ka nih ve avangin PHP Framework "Laravel" an hmang tih ka hre thei a. PHP source code hmu thei lo mah ila HTML source tal chu kan en teh ang ka ti a.

Ka han en chuan an web server chhung a an hla dah danah chuan pattern a awm a.

Lei hma a an hla sample ho chu /uploads/audio/album/24-intro/Hmalam_i_pan_ang.mp3 tiang hian an dah a.

/uploads/audio/album tih folder chhungah hian album id hrang hrang a awm a.  1-intro, 2-intro, 3-intro, 4-intro, 5-intro, ... ti hian a kal chho zel a. Chung album folder chhung ah chuan hla sample chu an dah zel a. a hnuai a screenshot hian a ti chiang thei awm e.

Album chhung a hla list lanna page HTML Source

Remkimi hla "Zoawi Lelte A Fam Ta" tih chu Rs. 10 ka lei a.




Ka han download dawn chuan a file link chu ka enchiang leh a. He ti hian a lo awm a.

http://www.mizostore.com/downloads/song/37/Zoawi_Lelte_a_fam_ta.mp3

WOW! WOW! WOW! a nih chuan /downloads/song/37/ tih folder chhunga hla awm hi chu ka ta ani vek mai lo maw? ka tia. Ka han enchiang a. Remkimi hla pakhat zawk "Ka chul zo (live)" chu http://www.mizostore.com/downloads/song/37/Ka_chul_zo_(Live).mp3 ti in awlsam em em in ka download ve thei ta reng mai a. Cheng 10 man kha a thlawm in ka download thei reng mai.

Tichuan folder dang ka han en leh a.

 http://www.mizostore.com/downloads/song/15/A_Kut_Phah_Ropui.mp3

Hei erawh chu access ka nei ve ta hauh lo mai. Hetah chuan a tha rih e.

Wow! Well Done!


Tichuan, Triau Trackx ho Album , ( Mizostore album id - 24 ) a vaia hla 14 awmna chu ka han en leh chhin a, "Bang tawh r'u" tih hla chu cheng 10 bawk in ka han lei leh rawih mai a.

Remkimi hla ka tih ang tho chuan album 24 (Triau Trackx) chhunga hla zawng zawng chu ka nei kim vek mai.

Ka lei tawh zawng zawng


Well, it basically means that once you bought a song from any album, you also bought the other songs.

I really do not mean to act in a offensive manner, but a defensive manner. I hope mizostore.com guys see this and fix this before more songs are uploaded to the website.

After I read all the Policies of mizostore, I do not find anything that prevents me from doing this, I make this post.

Mizo ten kan zithiamte hla kan thehdarh sak dan hi thlak ka duh ve tak zet a. Hah taka an siam music te a thlawn a lo inpek chhawn hi a tha lo hle in ka hre bawk (An phal a nih chuan thuhran!).

Hralh tura website lama an dah te pawh him se ka duh bawk.

And once again, offesnsive zawng ni lo defensive zawng a min ngaihsak ngei pawh ka beisei.

Fimkhur Rawh!
Share:

NLP AND ME! - E2: COLLECTING TEXT DATA


One of the most important thing in NLP is text data. Collecting text data is not a simple task, especially when it comes to minor language like Mizo.  This time I'd like share some simple tactics that I used for collecting a data for  Natural Language Processing research last year i.e. 2015 - 2016 academic session. 

A clean Mizo text data is not simply available. Since I was responsible for collecting a huge amount of clean Mizo text data, I had to go to some office of local newspapers like Vanglaini. We get a big file (may be larger than 3GB), but when we try to work on it, it is just a collection of useless stuffs for us. So, I had to make a clean data by myself. I plan to download every pages of their website and extract a clean text data from it.

I am a web developer! I know how websites work and how files like web pages are stored in the server. I know the pattern how they can display the pages.

If you see some websites, you may have seen the URL of the page ending as ?id=1234 , ?page=23, ?userid=1256, etc. These are the query with which you can request a page.

For example :
If you see  www.angelvestgroup.com/info.php?id=1, you will be redirected to a page. Now, if you modify the id to 2 i.e. www.angelvestgroup.com/info.php?id=2, you will go to a different page. Like that , you can go on. 

When a data is entered into the database, all the entry has given an ID or name so that the particular data can be extracted and displayed in the web browser. But I do not say that this is the only way! 
If you are a Facebook user, you may have seen something like profile.php?id=123456789! This is the profile ID of the user. By going to www.facebook.com/profile.php?id=XXXX, you can see whose profile is that.

Like this way, most of the news websites and blogs are implemented. 

Apparently, Vanglaini website uses a Laravel PHP Framework. If you see their website you will see a pattern in their web page which is similar to the above mentioned technique. 

They have six (6) directories viz., tualchhung, hmarchhak, ramchhung, khawvel, thalai and infiamna.

All the pages in the website have an ID which can be extract and displayed simply by the format:
        www.vanglaini.org/any_of_the_above_mentioned_directory/PAGEID

                  e.g: www.vanglaini.org/tualchhung/23456

The website have a good MVC (model view control) thing which is very good. The URL "www.vanglaini.org/tualchhung/12345" will display the same webpage as "www.vanglaini.org/thalai/12345" or "www.vanglaini.org/any_directory_name/12345". 

Since I recognized all these patterns, I can simple use the "wget" command in my Linux system to download all the pages that I required. 

I simply used the shell command below which gives me all the web pages that I require.

#!/bin/bash
for i in $(seq 1 1 61234)
do
   wget http://vanglaini.org/tualchhung/$i
done

Now after I downloaded all the requires pages, I need to make them into a text file. For this, a very simple but powerful program html2text is there to fulfill my requirement. The following lines of bash code did everything for me.

for file in `find . -type f -not -name "*.*"`; do html2text "$file" > "$file.txt"; done

This lines of codes converts all the files to a text file (.txt).

Now, I need only the TXT files. I can delete all the files which is not .txt file. I can do this by
          rm !(*.txt)

This bash command works very fine for me.

Now the only thing that I still need to do is to merge all the text files into one file, which can be done by using the cat command

cat *.txt > final.txt

which merge all the contents on all the txt file into a file called final.txt file.

In such a way, I collect a ~1GB of clean Mizo text data.

I tell you this, collecting 1GB of text data is such a big task and takes lots of time.






Share:

SIMPLE DATA ENTRY IN MYSQL DATABASE USING PHP

You may find a hell lot of tutorials on this topic, but may not work on your system because of what PHP version you are using! So, I'd also like to share a simple data entry into MySQL database using PHP! It may work with your system! :D

Note: For Beginner!

It'll be very short and simple, so that you can understand the whole code easily!

For this I will be using XAMPP (Apache) as a server ,specifically, version 5.5.37 , you may want to download it if you are going to follow this tutorial!

Depending on the Operating System you are using, you should download them!

For Windows User:

Just Install It! Hope you know how to install!

For Linux Users:



Now, to install into your system,
Go to Terminal.
Give the following commands:
cd /path-to-your-file
sudo chmod +x xampp-linux-x64-5.5.37-0-installer.run
sudo ./xampp-linux-x64-5.5.37-0-installer.run

I will not talk about Mac version as I haven't done on it!

Now, we can begin the coding! All our code should be located inside the htdocs folder of your xampp/lampp installation directory i.e. our workspace will be htdocs folder!

If you wonder where htdocs folder is;

For Windows user, the htdocs folder is usually in
C:/xampp/htdocs

For Linux users, it is inside /opt/lampp/htdocs
For this data entry, we will create only one file!
But, before that we will first explain each part one by one!
To enter data into the database we need to connect to the database first! And to connect to a database, we must have a database! LOL!
So, Lets create one database by going to http://127.0.0.1/phpmyadmin or http://localhost/phpmyadmin. Lets create one new database called directory!
Let's go to the SQL tab and enter the following query!

CREATE TABLE `members` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `phone` varchar(12) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Now, we have our database directory with a table members ! Lets start the connection!
Connection to the database can be created in a number of ways; mysqli (procedural), mysqli (object oriented) and pdo! Now, we are going to use procedural mysqli!
The connection to database is created as below:

<?php
$dbcon = @mysqli_connect("localhost","root","","directory");
if($dbcon){
    echo "";
}
else{
    echo "Error!";
}
?>

Before going further, lets create a simple html form!

<!DOCTYPE html>
<html>
<head>
    <title>Simple Data Entry</title>
</head>
<body style="max-width:600px;margin:auto;align:justify;padding:8px;">
<form action="entry.php" method="post">
<legend>PLEASE FILL UP!</legend><br/>
<label for="name">ENTER NAME:</label><br/>
    <input type="text" name="name"><br/>
<label for="phone">ENTER PHONE NUMBER:</label><br/>
    <input type="tel" name="phone"><br/>
<br/>
    <input type="hidden" name="submitinfo" value="TRUE">
    <input type="submit">
</form>
</body>
</html>

Now if any field is empty, we will notify that a field is empty! For that, we will require an array where we will store the error message!

$error = array();

To check whether a field is empty, we will use empty() library function as below:

if(!empty($_POST['name']))
        $name = $_POST['name'];
    else
        $error[] = "Please Enter Name!";

Now, if the error[] array is empty, we will insert data from html form into the database as below:

$query = "INSERT INTO `members` (`name`,`phone`) VALUES('$name','$phone')";

        $insert = mysqli_query($dbcon,$query);

Now, we can say that we are done!


Lets take a look at the while code.

<?php
//Lets connect the database....
$dbcon = @mysqli_connect("localhost","root","","directory");
if($dbcon){
    echo "";
}
else{
    echo "Error!";
}

//create one array to store error message....

$error = array();

//Let assign our html form data to our variables...

if(isset($_POST['submitinfo'])){ //if submit button is clicked!

    if(!empty($_POST['name']))
        $name = $_POST['name'];
    else
        $error[] = "Please Enter Name!";

    if(!empty($_POST['phone']))
        $phone = $_POST['phone'];
    else
        $error[] = "Please Enter Phone Number!";

    if(empty($error)){

        $query = "INSERT INTO `members` (`name`,`phone`) VALUES('$name','$phone')";

        $insert = mysqli_query($dbcon,$query);
        if(!$insert){
            echo "Query Failed!";
        }
        if(mysqli_affected_rows($dbcon)==1){
            echo "New Data Inserted!";
        }else{
            echo "Error!";

         }

    }else{
        echo '<ol>';

        foreach ($error as $key => $values) {

            echo '  <li>'.$values.'</li>';

        }
        echo '</ol>';
    }
    mysqli_close($dbcon);
}


?>

<!-- html form -->
<!DOCTYPE html>
<html>
<head>
    <title>Simple Data Entry</title>
</head>
<body style="max-width:600px;margin:auto;align:justify;padding:8px;">
<form action="<?php $_PHP_SELF; ?>" method="post">
<legend>PLEASE FILL UP!</legend><br/>
<label for="name">ENTER NAME:</label><br/>
    <input type="text" name="name"><br/>
<label for="phone">ENTER PHONE NUMBER:</label><br/>
    <input type="tel" name="phone"><br/>
<br/>
    <input type="hidden" name="submitinfo" value="TRUE">
    <input type="submit">
</form>
</body>
</html>

Name this file anything as you wanted (should be .php extension) and open your browser and go to http://localhost/your_file_name.php!

Enter any data, if there is anything wrong, please say it in the comment section!
Share:

NLP AND ME! - E1

I have been working as a undergrad researcher on the topic of  "Natural Language Processing" for like one year now, and I haven't write any details about it!

I made a post about some introduction to Mizo language processing. I mainly focus on Machine Translation only, and that is also very basic introduction! So, I'd like to share a few things that I knew about Natural Language Processing. I will make post about NLP  in series , because NLP is a very vast field and consist of many sub-topics.

It will not be like a lecture or instruction, but merely my opinions and my ideas. Some of it may be wrong, may not be applicable in NLP. But still, I'd like to share my opinions!

Me and my colleagues are working on Information Retrieval for Indian Languages, mainly Mizo language! Our research paper haven't published yet, so I will speak later.

Last winter vacation i.e December 2015 to January 2016, we are working on Mizo Parts of Speech Tagging, which is the first time for Mizo language. We have also created Mizo POS Tagger, which will soon be available to download for public!

Mizo language, in particular, have lots of ambiguity! Sometimes working on it makes me feel very dizzy! But, as I am working with a great programmer and a brilliant mind, we are able to overcome most of  the ambiguities!

Part of Speech Tagging for Mizo somehow requires a good knowloedge of grammar! Since POST is one of the very important piece of NLP, there no other option other than to solve the ambiguities.

If you may wonder what's the neccessities of it, you can see one application called Stanford Parser. Each word in a sentence is a part of  part of speech!

Consider a sentence:

Jeremy is a good programmer living in India

If you parse it in Stanford Parser, you will find the POS tagging result as:


Jeremy/NNP
is/VBZ
a/DT
good/JJ
programmer/NN
living/VBG
in/IN
India/NNP


NNP, NN, VBG, VBZ, JJ, DT, etc. are the part of speech tags! Different language will have different POS tags as the part of speech for different language is different!

If you wanna read more about Part of Speech tagging, you could find more about it in Wikipedia.
Like I said, I don't have a deep knowledge about POS tagging, I better not talk much about it!

One thing I knew about NLP is that, before we let our machine do work on its own, we have to do it for them manually!
Our POS tagger is also one such application which will be used to tag a POS manually! Once we finished all the documentation , I will share it for download! May be someday it will be one important tool for future researchers of Mizo NLP!
Share: