Hello, Reader ^^! Back again with source code. This time is a simple Factorial which is written in PHPprogramming language. This one will calculate factorial calculation. The GUI is still viewed with HTML but when the button is pressed, the PHP will work calculating the input you put. Okay, that's all I can say. Thank you for reading ^^!
Saturday, March 24, 2012
[PHP] Hello World
Hello, Reader ^^! Back again with source code. This time is a simple Hello World. Yeah, it is Hello World again but this time with PHP programming language. Well, I have assignments which need PHP to do it so I decided to learn this too and post some example of it here. Okay, that's all I can say. Thank you for reading ^^!
Cassava Chips
Hello, Reader ^^! Back again with photo of food which I ate the other day. The other day I ateCassava Chips. It had zig zag edges that time. It also has some very bit leiitle vegetable. It was alsosalty. When I ate just one, I couln't stop eating it until no chips left. Oh well, I guess it was too tastethat time or I was too hungry xD. Okay, that's all I can say. Thank you for reading ^^!
Friday, March 23, 2012
[Ruby] [Shoes] Hello World
Hello, Reader ^^! Back again with source code. This time is a simple Hello World. Yeah, it is a Hello World again with Ruby, but this time, the GUI "Shoes" is implemented. With this, I can put graphical elements to the program. In this example. a popup will appear if you click the button. Okay, that's all I can say. Thank you for reading ^^!
[C#] OFB (Output Feedback)
Hello, Reader ^^! Back again with source code. This time is is OFB (Output Feedback) which is made using C# programming language. This one, like CFB, also encrypts block per block from previous blocks. The first block came from Initialization Vector. The difference is the OFB uses Encryption Block from previous Encryption Block. The Encryption Block used in this example is the simple XOR. You can define your own Encryption Block like doing shift left, shift right, etc. Now, let me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 10101
IV generated : 10001
Encryption Block = a xor b
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
IV(only 1st block), then from the Third row | 10001 | 00100 | 10001 | 00100 |
Key | 10101 | 10101 | 10101 | 10101 |
Encryption Block (a xor b; a is IV, b is key) | 00100 | 10001 | 00100 | 10001 |
Plaintext (in bits) | 01011 | 11111 | 01010 | 10000 |
Xor-ed (Plaintext with third row) | 01111 | 01110 | 01110 | 00001 |
The result of encryption is 01111011100111000001.
Okay, that's all I can say. Thank you for reading ^^!
[C#] CFB (Cipher Feedback)
Hello, Reader ^^! Back again with source code. This time is is CFB (Cipher Feedback) which is made using C# programming language. This one, like CBC, also encrypts block per block from previous blocks. The first block uses Initialization Vector. The IV (and the next xor-ed plaintext and Encryption Block), will be encrypted into Encryption Block. After that, it will xor-ed with plaintext which will be the ciphertext. A mistake just a bit can lead mistake also in the encryption and decryption. The Encryption Block used in this example is the simple XOR. You can define your own Encryption Block like doing shift left, shift right, etc. Now, let me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 10101
IV generated 10001
Encryption Block = a xor b
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
IV(only 1st block), then from the Fifth row | 10001 | 10001 | 11011 | 01110 |
Key | 01011 | 10101 | 11111 | 00000 |
Encryption Block (a xor b; a is first row, b is key) | 11010 | 00100 | 00100 | 01110 |
Plaintext (in bits) | 01011 | 11111 | 01010 | 10000 |
Xor-ed (Plaintext with third row) | 10001 | 11011 | 01110 | 11111 |
The result of encryption is 10001110110111011111. If you see at the 3rd column, at the 2nd row, you will see the value is taken from 2nd column, 5th row. Yup, that's why it is chaining.
Okay, that's all I can say. Thank you for reading ^^!
[C#] CBC (Cipher-Block Chaining)
Hello, Reader ^^! Back again with source code. This time is is CBC (Cipher-Block Chaining) which is made using C# programming language. This one, uses encryption per block which came from the previous block. This way, the encryption becomes stronger, not only that, with Initialization Vector which is generated random, it made encryption more unique even with the same key. The IV can be kept or not, because when decryption, it won't effect the other block not like when enciphering. The Encryption Block used in this example is the simple XOR. You can define your own Encryption Block like doing shift left, shift right, etc. Now, let me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 10101
IV generated 10001
Encryption Block = a xor b
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
Plaintext(in bits) | 01011 | 11111 | 01010 | 10000 |
IV(only 1st block), then from the Encryption Block | 01011 | 10101 | 11111 | 00000 |
Xor-ed (Plaintext with second row) | 00000 | 01010 | 10101 | 10000 |
Key | 10101 | 10101 | 10101 | 10101 |
Encryption Block (a xor b; a is xor-ed bits, b is key) | 10101 | 11111 | 00000 | 00101 |
The result of encryption is 10101111110000000101. If you see at the 3rd column, at the 2nd row, you will see the value is taken from 2nd column, 5th row. Yup, that's why it is chaining.
One more thing, it also can encrypt and decrypt file like the other block cipher mode :D (I forgot to mention it with toher block cipher mode). Okay, that's all I can say. Thank you for reading ^^!
Wednesday, March 21, 2012
[C#] ECB (Electronic Code Book)
Hello, Reader ^^! Back again with source code. This time is is ECB (Electronic Code Book) which is made using C# programming language. There was a problem making it when facing the Unicode conversion to Binary and vice versa, but finally, it is solved :3. Now, Let me explain it again like the C++ before. Encryption using ECB is separating plaintext bit into blocks (key). After that, each block each encrypted with the block key. When the plaintext's length is not divideable by the key's length, pad it with all 0s or all 1s or 101010... In this example, the Encryption Block used is a simple xor. You can define your own Encryption Block. Now, let's me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 01101
Encryption Block = a xor b
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
Plaintext(in bits) | 01011 | 11111 | 01010 | 10000 |
Key per block | 01011 | 01011 | 01011 | 01011 |
Encryption Block (a xor b; a is Plaintext, b is key) | 00000 | 10100 | 00001 | 11011 |
The result of encryption is 00000101000000111011
Okay, that's all I can say. Thank you for reading ^^!
Monday, March 19, 2012
[Ruby] Rail Fence Cipher Extended
Hello, Reader ^^! Back again with source code. This time is a Rail Fence Cipher Extended which is made from Ruby programming language. This one is a bit difficult and tricky. The formula needed is also tricky. The coding of encryption is easier than the decryption. The difference with the normal version is that the Extended version also accept non-number and non-alphabet character. The alphaber is case-sensitive in this version. Now for a bit of demonstration:
Take a string "Hello World!"
Don't remove any character unlike the non-extended version.
Now, let's arrange them like this:
H o r
e l o l !
l w d
Now, based on its arranged form, from left to right and below, it is turned into HOLELWRDLO as the encryption result. That's how the Rail Fence Cipher do.
Okay, that's all I can say. Thank you for reading ^^!
Take a string "Hello World!"
Don't remove any character unlike the non-extended version.
Now, let's arrange them like this:
H o r
e l o l !
l w d
Now, based on its arranged form, from left to right and below, it is turned into HOLELWRDLO as the encryption result. That's how the Rail Fence Cipher do.
Okay, that's all I can say. Thank you for reading ^^!
[Ruby] OFB (Output Feedback)
Hello, Reader ^^! Back again with source code. This time is is OFB (Output Feedback) which is made using Ruby programming language. This one, like CFB, also encrypts block per block from previous blocks. The first block came from Initialization Vector. The difference is the OFB uses Encryption Block from previous Encryption Block. The Encryption Block used in this example is the simple XOR. You can define your own Encryption Block like doing shift left, shift right, etc. Now, let me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 10101
IV generated : 10001
Encryption Block = a xor b
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
IV(only 1st block), then from the Third row | 10001 | 00100 | 10001 | 00100 |
Key | 10101 | 10101 | 10101 | 10101 |
Encryption Block (a xor b; a is IV, b is key) | 00100 | 10001 | 00100 | 10001 |
Plaintext (in bits) | 01011 | 11111 | 01010 | 10000 |
Xor-ed (Plaintext with third row) | 01111 | 01110 | 01110 | 00001 |
The result of encryption is 01111011100111000001.
Okay, that's all I can say. Thank you for reading ^^!
Sunday, March 18, 2012
[Ruby] CFB (Cipher Feedback)
Hello, Reader ^^! Back again with source code. This time is is CFB (Cipher Feedback) which is made using Ruby programming language. This one, like CBC, also encrypts block per block from previous blocks. The first block uses Initialization Vector. The IV (and the next xor-ed plaintext and Encryption Block), will be encrypted into Encryption Block. After that, it will xor-ed with plaintext which will be the ciphertext. A mistake just a bit can lead mistake also in the encryption and decryption. The Encryption Block used in this example is the simple XOR. You can define your own Encryption Block like doing shift left, shift right, etc. Now, let me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 10101
IV generated 10001
Encryption Block = a xor b
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
IV(only 1st block), then from the Fifth row | 10001 | 10001 | 11011 | 01110 |
Key | 01011 | 10101 | 11111 | 00000 |
Encryption Block (a xor b; a is first row, b is key) | 11010 | 00100 | 00100 | 01110 |
Plaintext (in bits) | 01011 | 11111 | 01010 | 10000 |
Xor-ed (Plaintext with third row) | 10001 | 11011 | 01110 | 11111 |
The result of encryption is 10001110110111011111. If you see at the 3rd column, at the 2nd row, you will see the value is taken from 2nd column, 5th row. Yup, that's why it is chaining.
Okay, that's all I can say. Thank you for reading ^^!
Saturday, March 17, 2012
[Ruby] CBC (Cipher-Block Chaining)
Hello, Reader ^^! Back again with source code. This time is is CBC (Cipher-Block Chaining) which is made using Ruby programming language. This one, uses encryption per block which came from the previous block. This way, the encryption becomes stronger, not only that, with Initialization Vector which is generated random, it made encryption more unique even with the same key. The IV can be kept or not, because when decryption, it won't effect the other block not like when enciphering. Now, let me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 10101
IV generated 10001
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
Plaintext(in bits) | 01011 | 11111 | 01010 | 10000 |
Key per block | 10101 | 10101 | 10101 | 10101 |
IV(only 1st block), then with the ciphered block | 01011 | 10101 | 11111 | 00000 |
Xor-ed | 10101 | 11111 | 00000 | 00101 |
The result of encryption is 10101111110000000101. If you see at the 3rd column, at the 3rd row, you will see the value is taken from 2nd column, 4th row. Yup, that's why it is chaining.
Okay, that's all I can say. Thank you for reading ^^!
[Ruby] ECB (Electronic Code Book)
Hello, Reader ^^! Back again with source code. This time is is ECB (Electronic Code Book) which is made using Ruby programming language. Let me explain it again like the C++ before. Encryption using ECB is separating plaintext bit into blocks (key). After that, each block each encrypted with the block key. When the plaintext's length is not divideable by the key's length, pad it with all 0s or all 1s or 101010... Now, let's me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 01101
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
Plaintext(in bits) | 01011 | 11111 | 01010 | 10000 |
Key per block | 01011 | 01011 | 01011 | 01011 |
Xor-ed | 00000 | 10100 | 00001 | 11011 |
The result of encryption is 00000101000000111011
Okay, that's all I can say. Thank you for reading ^^!
Friday, March 16, 2012
[Ruby] Rail Fence Cipher
Hello, Reader ^^! Back again with source code. This time is a Rail Fence Cipher which is made from Ruby programming language. This one is a bit difficult and tricky. The formula needed is also tricky. The coding of encryption is easier than the decryption. Now for a bit of demonstration:
Take a string "Hello World!"
Remove all non-number and non-alphabet. Uppercase all of the string. Remove all the space. The result:
"HELLOWORLD"
Now, let's arrange them like this:
H O L
E L W R D
L O
Now, based on its arranged form, from left to right and below, it is turned into HOLELWRDLO as the encryption result. That's how the Rail Fence Cipher do.
Okay, that's all I can say. Thank you for reading ^^!
Take a string "Hello World!"
Remove all non-number and non-alphabet. Uppercase all of the string. Remove all the space. The result:
"HELLOWORLD"
Now, let's arrange them like this:
H O L
E L W R D
L O
Now, based on its arranged form, from left to right and below, it is turned into HOLELWRDLO as the encryption result. That's how the Rail Fence Cipher do.
Okay, that's all I can say. Thank you for reading ^^!
Thursday, March 15, 2012
[Trailer] Springbud by Vamplifire
Hello, Reader ^^! Today, I will show about the game which is being developed by my team. My team is called Vamplifire. We make the game to compete in the Imagine Cup 2012 which is held by Microsoft. The gameplay will be: help people by fulfilling their request. You will obtain source to complete the quest. The game itself will be 3D. Okay, that's all I will say right now. We won't tell everything, the other will be surprice :D. Thank you for reading ^^!
Credit:
1. Coder & Core Designer : Muhremantra
2. Bitmap GUI and Logic Coder : Vsio Stitched
3. 3D and Vector Graphic designer : Mavilion
4. Dot : Alissa Liu
API: XNAnimation
Credit:
1. Coder & Core Designer : Muhremantra
2. Bitmap GUI and Logic Coder : Vsio Stitched
3. 3D and Vector Graphic designer : Mavilion
4. Dot : Alissa Liu
API: XNAnimation
Wednesday, March 14, 2012
[Python] Factorial
Hello, Reader ^^! Back again with source code. This time is a simple Factorial. This time is with Python. Well, this one just doing a factorial calculation. It also checks whether the input is string or below 0. If that happens, error will occur. Plus, no result will be returned into the prompt. Okay, that's all I can say. Thank you for reading ^^!
Tuesday, March 13, 2012
[Contest] Color Scheme Contest Two Winners
Hello Reader :D! One day, there was a contest which happened at a DA group called #ThePixelPalace which the founder is shiney4ever . The contest was called Color Scheme Contest Two (Entry & Updated Page)(Winner Page). I posted it several days ago :D. The contest is making a pixel art with limited color: basic black, basic green, and basic yellow. Now, since I offered prize again which I will post every entry submitted in the contest in this blog, I created this post :D
Now, for these are contestants who participate in the contest :
Now, for these are contestants who participate in the contest :
Hungry Chameleon by ~Sanedu (1st Place)
Devil Skull by ~PiXEL-iMP (2nd Place)
Fluffbug by *RheaRatite (3rd Place)
Congratulation for those who have participated and the winner of the contest :D!
[Ruby] ROT13
Hello, Reader ^^! Back again with source code. This time is a simple ROT13. This one is a bit tricky but still easy. Playing with ASCII index is needed. To check whether a character is an alphabet, simple use the regular expression /[A-Z]/ for uppercase and /[a-z]/ for regular case. After that, switch the index by 13, then you will get the ROT13 result. Okay, that's all I can say. Thank you for reading ^^!
[Ruby] Palindrome Check
Hello, Reader ^^! Back again with source code. This time is a simple Palindrome Check. The only needed is using the built-in reverse function. Then compare it with the original string. If equal, then it is palindrome. Example, a string "pizza azzip" is a palindrome. One more thing, in this example, it is case-sensitive. Okay, that's all I can say. Thank you for reading ^^!
Sunday, March 11, 2012
[Ruby] Factorial
Hello, Reader ^^! Back again with source code. This time is a simple Factorial. Yup, it is just doing a factorial operation :p. This one shows how to create a function and raise (Ruby exception version). It handles whether the input is lower than 0. The operation is also using recursive method. Okay, that's all I can say. Thank you for reading ^^!
Saturday, March 10, 2012
[Python] Hello World
Hello, Reader ^^! Back again with source code. This time is a simple Hello World. This time is with Python. It's been a while too since I used Python to try a game engine using this xD. Well, it is time to warm up too with this programming language before starting with the main problem with this xD. Okay, that's all I can say. Thank you for reading ^^!
[C++] String To Binary String
Hello, Reader ^^! Back again with source code. This time is a simple String To Binary String. This function can convert string into binary string. I only need to use itoa and some 0 padding to do it. Now, let's me give a demonstration. If you put "I want a pizza!" string, it will be converted into "010010010010000001110111011000010110111001110100001000000110000100100000011100000110100101111010011110100110000100100001". Oh, I made this one since it is hard to find any example to convert a string into binary string >.< which pushed me into making this example :3. Okay, that's all I can say. Thank you for reading ^^!
[Ruby] Hello World
Hello, Reader ^^! Back again with source code. This time is a simple Hello World. Yup, it's been a while since I have been using Ruby and haven't posted any source code with Ruby so I decided to warm up myself first before I posted source code which is made from Ruby. Okay, that's all I can say. Thank you for reading ^^!
[C++] ECB (Electronic Code Book)
Hello, Reader ^^! Back again with source code. This time is is ECB (Electronic Code Book) which is made using C++. Encryption using ECB is separating plaintext bit into blocks (key). After that, each block each encrypted with the block key. When the plaintext's length is not divideable by the key's length, pad it with all 0s or all 1s or 101010... Now, let's me demonstrate a bit:
plain text (in bit) : 0101111111010101
key : 01101
Now, splitting them into 5 blocks (based on key's length): 01011|11111|01010|1
The last part length is not 5, so let's padding it with 0 bits : 10000
Plaintext(in bits) | 01011 | 11111 | 01010 | 10000 |
Key per block | 01011 | 01011 | 01011 | 01011 |
Xor-ed | 00000 | 10100 | 00001 | 11011 |
The result of encryption is 00000101000000111011
Now, in this one I made, to be able both the key and the plaintext readable, I also pad the key until it is dividable by 8.
Okay, that's all I can say. Thank you for reading ^^!
Thursday, March 8, 2012
[Javascript] Ranged Random Numbers Generator
Hello, Reader ^^! Back again with source code. This time is Ranged Random Numbers Generator which is coded using Javascript. This one is easy too. This one will generate random numbers in range. Plus, it also checks whether the input is number or not and checks whether the maximum is higher than minimum. Okay, that's all I can say. Thank you for reading ^^!
Wednesday, March 7, 2012
[Javascript] Content Based Radio Choice
Hello, Reader ^^! Back again with source code. This time is Content Based Radio Choice which is coded using Javascript. This one is easy. This one will generate content based on the choice which radio button is activated. It also changes when the radio button's which is clicked changed too. Okay, that's all I can say. Thank you for reading ^^!
Radio buttons, not selected
Radio buttons, selected which generates content based on choice
[Javascript] Comment Simulation
Hello, Reader ^^! Back again with source code. This time is Comment Simulation which is coded using Javascript. This one is more tricky. I use InnerHTML approach to add new comment. The one will simulate comments which the comment comes from the comment form. Btw, I deactivated the HTML tag effect for security reason. Okay, that's all I can say. Thank you for reading ^^!
Comment form, with no comment yet
Comments and the Comment Form
Tuesday, March 6, 2012
[Javascript] Spoiler
Hello, Reader ^^! Back again with source code. This time is Spoiler which is coded using Javascript. This one is a bit tricky, but still easy to do if you get better with the javascript, css, and html. This one will show or hide content when the button is pressed. Also, the spoiler box gets bigger each time the input from the text area gets bigger too. One more thing, you can also use html tag for more effect .Okay, that's all I can say. Thank you for reading ^^!
Content is Visible
Content is Hidden
Sunday, March 4, 2012
[Javascript] Factorial
Hello, Reader ^^! Back again with source code. This time is Factorial which is coded using Javascript. This one is using recursion to get the result. It also checks whether the input is full number or not. The checking is using regexp so it would be easier to test whether it is full number or not. Okay, that's all I can say. Thank you for reading ^^!
Saturday, March 3, 2012
Rice and Shrimp Noodle and Crisp Chicken with Baozi
Hello, Reader ^^! Back again with photo of food which I ate the other day. The other day I ate Rice and Shrimp Noodle and Crisp Chicken with Baozi. The shrimps was wrapped in fried noodle. The chicken was crisp. The rice was added with some kind of seasoning. After I ate them all, I ate the baozi as my desserts. It tasted sweet and it tasted like mung bean inside the baozi, but still not sure what was that. Okay, that's all I can say. Thank you for reading ^^!
Green Un Yellow Kota
Hello Reader ^^! Back again with art ^^! This time I made Green Un Yellow Kota. It is consists of 3 colors. They are green, black, and yellow. The content is a city, drawn in yellow and green lines, and black color as dots. If you try to zoom it or zoom out, it will morph into something. Oh, I made this one for Color Scheme Contest Two. I made this one in a rush since it is near deadline and I was busy that time doing a lot of assignments xD. Okay, that's all I can say. Thank you for reading ^^!
Special Record
- Contestant of Color Scheme Contest Two (Contest page) (Entry page)
Friday, March 2, 2012
Rice and Chicken Steak, Crisp Chicken, and Crisp Mushrooms
Hello, Reader ^^! Back again with photo of food which I ate the other day. The other day I ate Rice and Chicken Steak, Crisp Chicken, and Crisp Mushrooms. Yup, rice with mushrooms and two chickens. The mushrooom and the chickens are all crispy. My bite also tasted crispy from them. Ah, nice time when I ate crispy foods xD. Okay, that's all I can say. Thank you for reading ^^!
Thursday, March 1, 2012
Foorkat the Fur Cat
Hello, Reader ^^! Back again with art. This time I made a Foorkat the Fur Cat. It is a green mutated cat monster. The cat grows paw on its ears. It is more fuzzy than usual. It also turned more oval which turned it into carry-able monster. Oh, something more, I also made the shirt version. It is for competing in Cute Monster Design challenge. Please help Foorkat by voting the shirt version of it :3 (The link below under the image). Okay, that's all I can say. Thank you for reading ^^!
Special Record
- Shirt version (Click Here) is contestant of Cute Monsters Design Challenge
Rice with Spicy Sausages and Eggs
Hello, Reader ^^! Back again with photo of food which I ate the other day. The other day I ate Rice with Spicy Sausages and Eggs. The rice was eaten to ensure that I was satisfied when eating the dish. The taste of the sausages and the eggs were spicy and it could be felt inside both foods because when I cooked it, I also cooked it with the chopped chili. Okay, that's all I can say. Thank you for reading ^^!
[Assembly] [MIPS] Hello World
Hello, Reader ^^! Back again with source code ^^! This time the source code is Hello World written in Assembly (MIPS) language. Since I am new with this, there is very significant differences when I use the other language. That is because Assembly is a low-level programming language. With this language, I will play more with the register shifting. Now, with this program, for beginning, it will say the "Hello World!" phrase. Okay, that's all I can say. Thank you for reading ^^!
Subscribe to:
Posts (Atom)