Monday, September 25, 2006

[openssl] AES test program I

void aes_test()
{
AES_KEY ekey, dkey;
unsigned char key[16]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F };
unsigned char plaintext[16];
unsigned char ciphertext[16];
int i;

strcpy((char*)plaintext, "test1234567");
AES_set_encrypt_key(key,128,&ekey);
AES_set_decrypt_key(key,128,&dkey);

AES_encrypt(plaintext, ciphertext,&ekey);
printf("\nciphertext:\n");
for( i=0 ; i<16 ; i++)
printf("%02x ",buf[i]);

memset(plaintext,0,16);
AES_decrypt(ciphertext, plaintext,&dkey);
printf("\n"plaintext:\n");
for( i=0 ; i<16 ; i++)
printf("%02x ",in[i]);
}

Sunday, August 06, 2006

Python 3000

Google TechTalks
July 21, 2006

Guido van Rossum is a computer programmer who is best known as the author and Benevolent Dictator for Life of the Python programming language.

ABSTRACT
The next major version of Python, nicknamed Python 3000 (or more prosaically Python 3.0), has been anticipated for a long time. For years I have been collecting and exploring ideas that were too radical for Python 2.x, and it's time to stop dreaming and start coding. In this talk I will present the community process that will be used to complete the specification for Python 3000, as well as some of the major changes to the language and the remaining challenges.

Predicting bugs in code changes using SCM information

Google TechTalks
March 8, 2006

Jim whitehead
Jim Whitehead is an Assistant Professor of Computer Science at the University of California, Santa Cruz. He has recently been developing a new degree program on computer gaming, the BS in Computer Game Engineering. Jim received his PhD in Information and Computer Science from UC Irvine, in 2000

Abstract:
Almost all software contains undiscovered bugs, ones that have not yet been exposed by testing or by users. Wouldn't it be nice if there was a way to know the location of these bugs? This talk presents two approaches for predicting the location of bugs. The bug cache contains 10% of the files in a software project.

Thursday, June 22, 2006

__attribute__((packed))

프로그래밍중 가끔 실수하는것이 구조체의 바이트 정렬이다.
보통 시스템이 32비트이므로 4바이트로 정렬이 된다. 같은 머신에서 돌아가는 소프트웨어일 경우는 문제가 생기지 않으나 다른 머신과 통신하는 프로그램일 경우 문제가 발생한다.

typedef struct {
struct color{
uchar blue;
uchar read;
uchar black;
}
int made_in;
} apple;


위 구조체의 경우 __attribute__((packed))을 사용하지 않았으므로 8바이트가 할당된다.
color구조체는 3바이트만 사용했지만 바이트 정렬문제로 4바이트가 되서 총 8바이트다. 이런 문제를 사전에 방지하기 위해 __attribute__((packed))를 사용해야 한다.

typedef struct {
struct color{
uchar blue;
uchar read;
uchar black;
}
int made_in;
}__attribute__((packed)) apple;


윈도우의 비주얼씨에서는 #pragma pack(1)을 선언한다.

Wednesday, April 12, 2006

[버그 트래킹 시스템]mantis에서 한글 설정하기

To use "korean_utf8",
config_defaults_inc.php파일에서 $g_language_choices_arr = array( )에 'korean_utf8'를 추가해 주면 됩니다.

ex) $g_language_choices_arr = array( 'english', 'french', 'german','korean_utf8' );