Saturday, December 12, 2009

colorscheme: my_murphy

" local syntax file - set colors on a per-machine basis:
" vim: tw=0 ts=4 sw=4
" Vim color file
" Maintainer: Ron Aaron
" Last Change: 2003 May 02

hi clear
set background=dark
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "murphy"

hi Normal ctermbg=Black ctermfg=lightgreen guibg=Black guifg=lightgreen
hi Comment term=bold cterm=bold ctermfg=cyan gui=italic guifg=#80a0ff
"hi Comment term=bold cterm=bold ctermfg=cyan guifg=#80a0ff
"hi Comment term=bold ctermfg=LightRed guifg=Orange
"hi Constant term=underline ctermfg=LightGreen guifg=White gui=NONE
hi Special term=bold cterm=bold ctermfg=red guifg=Orange
hi Constant term=underline cterm=bold ctermfg=magenta guifg=#ffa0a0
hi Identifier term=underline ctermfg=LightCyan guifg=#00ffff
hi Ignore ctermfg=black guifg=bg
hi PreProc term=underline ctermfg=darkmagenta guifg=#ff80ff
"hi PreProc term=underline ctermfg=LightBlue guifg=Wheat
hi Search term=reverse guifg=white guibg=Blue
hi Special term=bold ctermfg=LightRed guifg=magenta
hi Statement term=bold ctermfg=Yellow guifg=#ffff00 gui=NONE
hi Type ctermfg=LightGreen guifg=grey gui=none
hi Error term=reverse ctermbg=Red ctermfg=White guibg=Red guifg=White
hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow
" From the source:
hi Cursor guifg=Orchid guibg=fg
hi CursorLine term=underline cterm=underline guibg=grey20
hi Directory term=bold ctermfg=LightCyan guifg=Cyan
hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
hi IncSearch term=reverse cterm=reverse gui=reverse
hi LineNr term=underline ctermfg=Yellow guifg=Yellow
hi ModeMsg term=bold cterm=bold gui=bold
hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen
hi NonText term=bold ctermfg=Blue gui=bold guifg=Blue
hi Question term=standout ctermfg=LightGreen gui=bold guifg=Cyan
hi SpecialKey term=bold ctermfg=LightBlue guifg=Cyan
hi Title term=bold ctermfg=LightMagenta gui=bold guifg=Pink
hi WarningMsg term=standout ctermfg=LightRed guifg=Red
hi Visual term=reverse cterm=reverse gui=NONE guifg=white guibg=darkgreen
hi String term=underline cterm=bold ctermfg=grey guifg=grey
hi StatusLine term=reverse,bold cterm=reverse gui=NONE guifg=White guibg=darkblue
hi StatusLineNC term=reverse cterm=reverse gui=NONE guifg=white guibg=grey40
hi StatusLineB1 cterm=none ctermbg=black ctermfg=yellow gui=bold guibg=#800000 guifg=black
hi StatusLineB2 cterm=none ctermbg=black ctermfg=yellow gui=bold guibg=#804000 guifg=black
hi StatusLineB3 cterm=none ctermbg=black ctermfg=yellow gui=bold guibg=#808000 guifg=black
hi StatusLineB4 cterm=none ctermbg=black ctermfg=yellow gui=bold guibg=#008000 guifg=black
"hi StatusLineB5 cterm=none ctermbg=black ctermfg=yellow gui=bold guibg=#000080 guifg=black
hi StatusLineB5 cterm=none ctermbg=black ctermfg=yellow gui=bold guibg=#008080 guifg=black
hi StatusLineB6 cterm=none ctermbg=black ctermfg=yellow gui=bold guibg=#800080 guifg=black
"hi link String Constant

Saturday, June 13, 2009

食品卫生微生物

食品卫生微生物  
编写人:工程系
食品微生物精品课程课题组
本章目录
第一节 微生物与食物中毒
第二节 污染食品与常见疫病
第三节 食品卫生的微生物指标
第一节 微生物与食物中毒  
   
  食物中毒潜伏期短,来热急剧,常集体性暴发,短时间内有很多人同时发病,且有相同的临床表现;一般人和人之间不直接传染。 
一、食物中毒的概念及其类型 
  食物中毒是指人体因食用了含有有害微生物、或微生物毒素、化学性有害物质而出现的非传染性的中毒。
  根据引起食物中毒的微生物类群不同,微生物性食物中毒又分为细菌性食物中毒和真菌性食物中毒。
二、细菌性食物中毒 
(一)金黄色葡萄球菌食物中毒
1.病原菌
  金黄色葡萄球菌(Staphylococcus aureus)为兰氏阳性球菌。无芽孢,无鞭毛,不能运动,呈葡萄状排列。兼性厌氧菌,对营养要求不高,在普通琼脂培养基上培养24h,菌落圆形、边缘整齐、光滑湿润不透明,颜色呈金黄色。最适生长温度为35℃~37℃,最适pH7.4。此菌对外界的抵抗力是不产芽孢细菌中最强的一种,加热80℃30min至1h才能杀死。 
2.毒素和酶
  金黄色葡萄球菌能产生多种毒素和酶,故致病性极强。
  致病菌株产生的毒素和酶主要有溶血毒素、杀白血球毒素、肠毒素、凝固酶、溶纤维蛋白酶、透明质酸酶、DNA酶等。与食物中毒关系密切的主要是肠毒素。 
3.中毒原因及症状
  当金黄色葡萄球菌肠毒素进入人体消化系统后被吸收进入血液。毒素刺激中枢神经系统而引起的中毒反应。潜伏期一般为1h5h,最短为15min左右,最长不超过8h。中毒症状有恶心、反复呕吐、多者可达10余次,并伴有腹痛、头晕、腹泻、发冷等。儿童能肠毒素比成人敏感。因此儿童发病率较高,病情也比成人重。
  但金黄色葡萄球菌肠毒素中毒病程较短,1d~2d内即可恢复,愈后良好,一般不导致死亡。 
4.病菌来源及预防措施
  主要污染来源包括原料和生产操作人员
  预防金黄色葡萄球菌食物中毒包括防止葡萄球菌污染和防止其肠毒素形成两个方面。应从以下几方面采取措施:防止带菌人群对食品的污染 ;防止葡萄球菌对食品原料的污染 ; 防止肠毒素的形成 。
(二)沙门氏菌食物中毒 
1.病原菌
  沙门氏菌(Salmonella) 属于肠道病原菌。革兰氏阴性,无芽、无荚膜,两端钝圆短杆菌。除鸡伤寒沙门氏菌外,均周生鞭毛,能运动,多数具有菌毛。最适生长温度为37℃,最适生长pH为6.8~7.8。在普通琼脂培养基上培养24h,菌落圆形、表面光滑、无色、半透明、边缘整齐。该菌对热、消毒药水及外界环境的抵抗力不强。
2.食物中毒原因及症状
  沙门氏菌引起的食物中毒有多种多样的中毒表现,一般可分为胃肠炎型、类伤寒型、类霍乱型、类感冒型和败血症型5种类型。其中胃肠炎型最为多见。潜伏期一般为12h~36h,短者6h ,长者为48h~72h,大多集中在48h内,超过72h的不多。潜伏期短者,病性较严重。 
  沙门氏菌食物中毒的临床症状一般在进食12h~24h后出现。主要表现为急性肠胃炎症状。发病初期表现为寒战、头痛、恶心、食欲不振等,以后出现腹痛、呕吐、腹泻甚至发热等,严重的会出现抽搐及昏迷等症状。病程一般为3d~7d,愈后良好。但老人、儿童和体弱者可能出现面色苍白、四肢发凉、血压下降甚至休克等症状,如不及时救治也可能导致死亡。 
3.病菌来源及预防措施
   
(三)大肠埃氏菌食物中毒
 1.病原菌
  大肠杆菌均为革兰氏阴性菌,两端钝圆的短杆菌,大多数菌株有周生鞭毛,能运动,有菌毛,无芽孢。某些菌株有荚膜,大多为需氧或兼性厌菌。生长温度范围为10℃~50℃,最适生长温度为40℃,最适pH为6.0~8.0。在普通琼脂平板培养基培养24h后呈圆形、光滑、湿润、半透明近无色的中等大菌落,其菌落与沙门氏菌的菌落很相似。但大肠杆菌菌落对光观察可见荧光,部分菌落可溶血(β型)。 
2.食物中毒原因及症状
  症状表现为腹痛、腹泻、呕吐、发热、大使呈水样或呈米泔水样,有的伴有脓血样或粘液等。一般轻者可在短时间内治愈,不会危及生命 
3.病菌来源与预防措施
 预防第二次污染。
 
 预防交叉污染。
 
 控制食源性感染。 
(四) 肉毒梭菌食物中毒
   
1.病原菌
  肉毒梭菌(C.Botulinum),又叫肉毒杆菌和肉毒梭状芽孢杆菌。为革兰氏阳性粗大杆菌。两端钝圆,无荚膜,周生鞭毛,能运动。严格的厌氧菌,对营养要求不高,,最适生长温度28℃~37℃,生长最适pH7.8~8.2,在20℃~25℃在菌体次未端形成芽孢。当环境温度低于15℃或高于55℃时,肉毒梭菌芽孢不能生长繁殖,也不产生毒素。肉毒梭菌加热至80℃时30min 或100℃时10min即可杀死。
  但芽孢耐热能力强,需经高压蒸汽121℃30min才能将其杀死。 
2.食物中毒原因及症状
  早期的症状为头痛、头晕、然后出现视力模糊、张目困难等症状,还有的声音嘶哑,语言障碍,吞咽困难等,严重的可引起呼吸和心脏功能的衰竭而死亡。由于肉毒素对知觉神经和交感神经无影响,因而病人从开始发病到死亡,始终保持神志清楚,知觉正常状态。 
3. 病菌来源与预防措施
  为了预防肉毒梭菌中毒的发生,除加强食品卫生措施外,还应注意:
(1)在食品加工过程中,应使用新鲜的原料,避免泥土的污染。
(2)生产罐头食品及真空食品必须严格无菌操作,装罐后要彻底灭菌。
(3)加工后的食品应避免再次污染和较高温度或缺氧条件下存放。 
三、霉菌引起的食物中毒 
1.黄曲霉毒素(Aflatoxins 简称AT)
  黄曲霉毒素具有耐热的特点,裂解温度为280℃,所以一般的烹调方法不能消除。它在水中的溶解度很低,溶于油脂和多种有机溶剂。
  是一种强烈的肝脏毒,强烈抑制肝脏细胞中RNA的合成,阻止和影响蛋白质、脂肪、线粒体、酶等的合成和代谢,干扰人与动物的肝脏功能,导致突变、癌症及肝细胞坏死。因而,饲料中的毒素可以和积畜在动物的肝脏、肾脏和肌肉组织中,人食用了污染黄曲霉毒素的食品可引起慢性中毒。
2. 霉菌性食物中毒的预防措施 
(1)防霉 

(2)去霉 
第二节 污染食品与常见疫病  
一、炭疽杆菌 
(一)生物学特性 






1 .形态与染色特性
  本菌是粗大的、不运动的革兰氏阳性大杆菌,一般染料着色良好。菌体长4~8 um,宽1.0~1.5um。在涂片标本小,呈单在或链状排列.杆菌的未端直截或稍凹陷,以致菌体连接起颇似竹节状。炭疽杆菌在动物体内形成荚膜。在动物体外形成芽孢.荚膜对炭疽杆菌具有保护功能.并且体现毒力。无荚膜株,通常无毒性。 
2 .培养特性
  本菌是需氧苗,在有氧条件下发育最好。对营养要求不严格,在一般培养基上即可生长。最适生长温度为37C,pH为7.2~7.6。
  普通营养琼脂:培养18~24h,形成直径2—3mm,大而扁平、粗糙、灰白色、不透明、边缘不整齐的火焰状菌落。用低倍显微镜观察,菌落呈卷发状。
3 .生化特性
  炭疽杆菌能分解葡萄糖、麦芽糖、蔗糖、菊糖、果糖和草糖,有些菌株尚可迟缓发酵甘油及水杨素。均产酸不产气,能水解淀粉和乳蛋白,不发酵乳糖,阿拉伯胶糖、鼠李糖、甘露糖、半乳糖、棉子糖、甘露醇、卫矛醇和山梨醇,能还原硝醒盐为亚硝酸盐。 
4 .抗原结构
(1)保护性抗原
 
(2)荚膜抗原 

(3)菌体抗原
 
(4)芽孢抗原 
5 .抵抗力
  炭疽杆菌繁殖体的抵抗力与一般细菌相似,但芽孢抵抗力甚强。在干燥土壤中,如不以阳光直接照射,可保持生活力达数十年之久.牧场一旦被污染,传染性可保持20~30年。对热抵抗力强,煮沸10min或干热140C℃ 3h才能杀死芽孢。 
6 .致病性
  炭疽杆菌主要引起草食动物发病,以绵羊、牛、马、鹿等最易感染,猪,山羊较差,禽类一般不感染。人对炭疽的易感性仅次于牛、羊。 
  炭疽菌毒素可增加微血管的通透性,改变血液循环正常进行,损害肾脏功能,干扰糖代谢,最后导致动物死亡。 
(二)传染途径及症状
  人多为接触性传染,人感染本病也多半表现为局限型,分为皮肤炭疽、肠炭疽和肺炭疽。人的感染途径主要是:屠宰工人通过破损的皮肤和外表黏膜接触感染,病畜肉或其加工制品中带有炭疽芽孢,处理不当,食后引起肠型炭疽,处理和运送畜产品,因吸入含炭疽芽孢的尘埃,发生肺炭疽。
  皮肤炭疽表现为斑疹、丘疹、水泡。水疱周围水肿,水疱破溃后形成溃疡,结成黑色痴皮,黑色痴皮为本病的特征,故称炭疽. 
(三)防治措施
1. 给牲畜定期注射炭疽孢苗.。
2. 死亡患畜一旦确诊即或怀疑本病,严禁尸体解剖诊断,并按畜产品、食品卫生保健有关规定处理。
3. 加强饮食卫生工作,熟食品加热后再食。  
二、结核分枝杆菌 
(一)生物学特性
1. 形态与染色特性
  在病灶内菌体正直或微弯曲,有时菌体末端具有不同的分枝,有的两端钝圆,无鞭毛,无荚膜和无芽孢,没有运动性。本菌为革兰氏阳性菌。 
2.培养特性
  本菌为严格需氧菌。最适生长温度为37~37.5℃、本菌生长速度很慢。结核杆菌对营养要术极高,必须在含有血清、鸡蛋、甘油等的特殊培养基上才能良好的生长。
  菌落呈灰黄白色、干燥颗粒状、显著隆起,表面粗糙皱缩、菜花状的菌落。 
3. 生化特性
  结核杆菌不发酵糖类,能产业过氧化氢酶。 
4. 抵抗力
  本菌含有大量的脂类,抵抗力较强。对于干燥的抵抗力特别强大。它在干燥状态可存活2—3个月,在腐败物和水中存活5个月,在土壤中存活7个月到1年。低温菌体不死,而且在零下190℃时还保持活力。 
(二)传染源、传染途径及症状
  结核杆菌来自病人和病畜的病灶。病菌随着痰液、尿液,粪便、乳液或其他分泌物排出体外而传播。病菌除通过呼吸道侵人人体外,也可以由污染的食品和饮用水感染.牛对结核杆菌有较高的易感性。患有结核病的乳牛,其乳中含有结核菌,人吃了消毒不彻底的这种乳,就会得结核病。
  结核杆菌几乎可侵犯人和动物的所有器官组织,引起周围和全身病变。 
(三)防治措施
1.搞好乳牛的卫生管理 

2. 结核病治疗药物 
第三节食品卫生的微生物学指标  
一、主要检测指标 
  目前,食品卫生标准中的微生物指标一般分为细菌总数、大肠菌群和致病菌等。 
(一)细菌总数  
  细菌总数是指在牛肉膏蛋白胨琼脂培养基上长出的菌落数,平皿菌落计数法测定食品中的活菌数,一般以1g或 lml食品所含的细菌数来表示。 
细菌总数的食品卫生意义
  一方面作为食品被污染,即清洁状态的标志;
  另一方面可以用来预测食品可能存放的期限。食品中细菌数较多,将加速食品的腐败变质,甚至可引起食用者的不良反应 
(二)大肠菌群
  大肠菌群系指一群在37℃,经24h能发酵乳糖,并产酸产气,需氧或兼性厌氧生长的革兰氏阴性的无芽孢杆菌。其中包括有大肠杆菌,产气杆菌和一些中间类型的细菌。这群细苗能在含有胆盐的培养基上生长。 

  由于大肠菌群都是直接或间接来自人与温血动物的粪便,来自粪便以外的极为罕见。所以,大肠菌群作为食品卫生标准的意义在于,它是较为理想的粪便污染的指示菌群,另外,肠道致病菌如沙门氏菌属和志贺氏菌属等,对食品安全性威胁很大.经常检验致病菌有一定困难。而食品中的大肠菌群教容易检出来,肠道致病菌与大肠菌群的来源相同,而且在一般条件下大肠菌群在外环境中生存时间也与主要肠道致病菌一致.所以大肠菌群的另一重要食品卫生意义是作为肠道致病菌污染食品的指示菌.
(三)致病菌 
  致病菌系指肠道致病菌、致病性球菌、沙门氏菌等。
  食品中不允许有致病菌存在,这是食品卫生质量指标中必不可少的标准之一。 
  此外,有些致病菌能产生毒素,毒素的检查也是一项不容忽视的指标,因为有时当菌体死亡后,毒素还继续存在。毒素的检查一般以动物实验法,确定其最小致死量、半数致死量等指标。总之,病原微生物及其代谢产物的检查都属致病菌检验内容。 
二、常见食品的微生物标准 
请参见国家标准

Tuesday, May 26, 2009

perl vs xml vs excel

use Spreadsheet::ParseExcel;
use XML::DOM;
my $doc = XML::DOM::Document->new;

my $xml_pi = $doc->createXMLDecl ('1.0',"UTF-8","yes");
$doc->setXMLDecl($xml_pi);

my $root = $doc->createElement('tests');
$root->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance");

my $parser = Spreadsheet::ParseExcel->new(
  CellHandler => \&cell_handler,
  NotSetCell => 1
);

my $workbook = $parser->Parse($filename);
$root->printToFile ($outFile);

exit(0);

  sub cell_handler {

  my $workbook = $_[0];
  my $sheet_index = $_[1];
  my $row = $_[2];
  my $col = $_[3];
  my $cell = $_[4];
 my $myTag;
 my $myText;

  $testName=$cell->value();
  if ($testName !~ m{\w+\.sv}) {$testName = ""; $lastCol = -1; return;}
  $test = $doc->createElement('Test');
  $myTag = $doc->createElement('Name');
  $myText = $doc->createTextNode($cell->value());
  $myTag->appendChild($myText);    #set text content for this tag
  $test->appendChild($myTag);

  if ($implemented == 1) { $root->appendChild($test); } # add new entry only if it's new line

}

Monday, May 25, 2009

install perl module as non-root

perl Makefile.PL, make, make test, make install

The standard way to install a Perl module on Unix is to change into the directory that was created when you unpacked the .tar.gz file, and then type the following sequence of commands:

  perl Makefile.PL
  make
  make test
  make install


This will create a makefile for you, then compile the module, test it, and put it in the correct location for you. This requires that you are logged in as root, so that you can copy files to the Perl library directory, and various other places on your system where the installation will put files.

If you do not have root permissions on the machine where you want to install the module, such as if you wish to install a module in your home directory, just change one of those commands. Instead of

  perl Makefile.PL

type

  #perl Makefile.PL PREFIX=/path/to/where/you/want/it
  perl Makefile.PL INSTALL_BASE=/path/to/where/you/want/it

 make install

That will put all the files in that directory. In order to use modules that are stored in that location, you will need to add the following like to your Perl programs:

  use lib "/path/to/where/you/want/it/perl5"
and, yes, thanks for the comment, local::lib might be easier to install a new module.
  use local::lib "/path/to/where/you/want/it/perl5"

Saturday, April 25, 2009

encryption

Most of then are concerpted from wikipedia.

and some from cisco

CSS:

Content Scramble System (CSS) is a Digital Rights Management (DRM) scheme used on almost all commercially produced DVD-Video discs. It utilizes a proprietary 40-bit stream cipher algorithm. The system was introduced around 1996 and has subsequently been compromised.

CSS key is a collective term for authentication key, disc keys, player keys, title keys, secured disk key set, and/or encrypted title keys.

Some of the keys are stored on the lead-in area of the disk, which is generally only read by compliant drives. Keys can be passed from a DVD drive to a descrambler over a PC bus using a secure handshake protocol

he purpose of CSS is twofold. First and foremost, it prevents byte-for-byte copies of an MPEG stream from being playable since such copies will not include the keys that are hidden on the lead-in area of the restricted DVD disk. Second, it provides a reason for manufacturers to make compliant devices, since CSS scrambled disks will not play on noncompliant devices. Anyone wishing to build compliant devices must obtain a license, which contains the requirement that the rest of the DRM system be implemented.

In October 1999 the algorithm and DeCSS was released.  Structural flaws in the algorithm reduced the effective key length to only around 16 bits, which could be brute-forced by a 450 MHz processor in less than a minute.

DES

Published as the U.S. Federal Information Processing Standard 46 in 1977, DES is still widely used, despite being proven inadequate for use in many applications. It is a symmetric block cipher (shared secret key), with its block size fixed at 64 bits. There are four defined modes of operation, with the Electronic Code Book (ECB) mode being the most widely used. Additionally, DES has been incorporated into numerous other standards, such as American Bankers Association's Protection of Personal Identification Numbers in Interchange Standard, Management and Use of Personal Identification Numbers Standard, Key Management Standard, and three ANSI standards, Data Encryption Algorithm (DEA), Standard for Personal Identification Number (PIN) Management and Security, and Standard for Financial Institution Message Authentication [3]. In particular, DES is also specified as an approved algorithm in the IP Security Architecture (IPSec) standard [9], which is used in the equipment from many different suppliers.

Key length is one of the two most important security factors of any encryption algorithm—the other one being the design of the algorithm itself. DES uses a 64-bit block for the key; however, 8 of these bits are used for odd parity and are, therefore, not counted in the key length. The effective key length is then calculated as 56 bits, giving 256 possible keys. A true 64-bit key has 256 times as many keys, whereas a 128-bit key is 272 times "better" than a 56-bit key. As if this was not enough, DES also has so-called weak and semi-weak keys. During the encryption process, the key is used to generate two values that are used for separate purposes during the process. These 16 weak and semi-weak keys will produce values that don't appear to be random. They will give outputs of all-ones, all-zeros, or distinguishable patterns of ones and zeros. It is generally recognized that these 16 key values should not be used. The key length was known to be a factor in trusting DES soon after DES was published. For this reason, people started exploring the use of multiple encryption passes and multiple keys. Triple DES (3DES) is a way of using DES encryption three times.

The most common method is to first encrypt the data block with one key. The output of this operation is run through the decryption process with a second key, and the output of that operation is run through the encryption process again with the first key. This process makes the effective key length 112 bits long. Again, the problem with weak and semi-weak keys remains. The disadvantage of Triple DES is that it is about one-third as fast as DES when processing data. This effort just slightly extended the life of DES while a suitable alternative could be found.

Because some internal structures used in DES are not designed to be strong against linear cryptanalysis, it is quite effective when used against DES. To show that the DES is inadequate and should not be used in important systems anymore.

When spoken, "DES" is either spelled out (IPA: /diː iː ɛs/) as an abbreviation or pronounced as a single syllable (IPA: /dɛs/) acronym

AES

Advanced Encryption Standard (AES) is an encryption standard adopted by the U.S. government. The standard comprises three block ciphers, AES-128, AES-192 and AES-256, adopted from a larger collection originally published as Rijndael. 

As of 2009, AES is one of the most popular algorithms used in symmetric key cryptography. AES is the first publicly accessible and open cipher approved by the NSA for top secret information.Unlike its predecessor DES, AES does not use a Feistel network.

AES has a fixed block size of 128 bits and a key size of 128, 192, or 256 bits, whereas Rijndael can be specified with block and key sizes in any multiple of 32 bits, with a minimum of 128 bits and a maximum of 256 bits.
Assuming one byte equals 8 bits, the fixed block size of 128 bits is 128 ÷ 8 = 16 bytes. AES operates on a 4×4 array of bytes, termed the state. he AES cipher is specified as a number of repetitions of transformation rounds that convert the input plain-text into the final output of cipher-text. Each round consists of several processing steps, including one that depends on the encryption key. A set of reverse rounds are applied to transform cipher-text back into the original plain-text using the same encryption key.

High-level description of the algorithm

1. KeyExpansion using Rijndael's key schedule

2.Initial Round
AddRoundKey
Rounds
SubBytes—a non-linear substitution step where each byte is replaced with another according to a lookup table - an 8-bit substitution box, the Rijndael S-box
ShiftRows—a transposition step where each row of the state is shifted cyclically a certain number of steps.
MixColumns—a mixing operation which operates on the columns of the state, combining the four bytes in each column
AddRoundKey—each byte of the state is combined with the round key; each round key is derived from the cipher key using a key schedule.
3.Final Round (no MixColumns)
SubBytes
ShiftRows
AddRoundKey

M6

M6 is a block cipher proposed by Hitachi in 1997 for use in the IEEE 1394 FireWire standard.

The algorithm operates on blocks of 64 bits using a 10-round Feistel network structure. The key size is 40 bits by default, but can be up to 64 bits. Because its round function is based on rotation and addition, M6 was one of the first ciphers attacked by mod n cryptanalysis. Mod 5, about 100 known plaintexts suffice to distinguish the output from a pseudorandom permutation. Due to its simple key schedule, M6 is also vulnerable to a slide attack, which requires more known plaintext but less computation.

C2

The Cryptomeria cipher, commonly referred to as C2, is a proprietary block cipher defined and licensed by the 4C Entity. It is the successor to CSS algorithm (used for DVD-Video) and was designed for the CPRM/CPPM Digital Rights Management scheme which are used by DRM-restricted Secure Digital cards and DVD-Audio discs.

Like DES, it has a key size of 56 bits and a block size of 64 bits. The encryption and decryption algorithms are available for peer review, but implementations require the so-called "secret constant", the values of the substitution boxes, which are only available under a license from the 4C Entity.

SHA

The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency (NSA).SHA stands for Secure Hash Algorithm. The three SHA algorithms are structured differently and are distinguished as SHA-0, SHA-1, and SHA-2. The SHA-2 family uses an identical algorithm with a variable digest size which is distinguished as SHA-224, SHA-256, SHA-384, and SHA-512.

SHA-1 is the best established of the existing SHA hash functions, and is employed in several widely used security applications and protocols.In 2005, security flaws were identified in SHA-1, namely that a possible mathematical weakness might exist, indicating that a stronger hash function would be desirable. Although no attacks have yet been reported on the SHA-2 variants, they are algorithmically similar to SHA-1 and so efforts are underway to develop improved alternatives.[2][3] A new hash standard, SHA-3, is currently under development.

SHA-1 (as well as SHA-0) produces a 160-bit digest from a message with a maximum length of (264 − 1) bits. SHA-1 is based on principles similar to those used by Ronald L. Rivest of MIT in the design of the MD4 and MD5 message digest algorithms, but has a more conservative design.

NIST published four additional hash functions in the SHA family, named after their digest lengths (in bits): SHA-224, SHA-256, SHA-384, and SHA-512. The algorithms are collectively known as SHA-2.

SHA-256 and SHA-512 are novel hash functions computed with 32- and 64-bit words, respectively. They use different shift amounts and additive constants, but their structures are otherwise virtually identical, differing only in the number of rounds. SHA-224 and SHA-384 are simply truncated versions of the first two, computed with different initial values.

Wednesday, April 8, 2009

ts subsystem

podci: 6-1 mux, stream formating output; and direct muxed output

    suport stream formating, i.e. clock/sync recovery, data s2p, etc

btr:bi-directional transport interface that write/read data to/from mem.

 And STC(System Time Counter) and provide sync check/maintenance

hostif: will be responsible for cicam programming

a pcmcia compatible interface is used, supporting 68k & sram strobe timing

Tuesday, April 7, 2009

Transport stream (TS, TP, MPEG-TS, or M2T) is a communications protocol for audio, video, and data. It is a type of digital container format that encapsulates packetized elementary streams and other data. TS is specified in MPEG-2 Part 1, Systems (ISO/IEC standard 13818-1)

Transport stream offers features for error correction for transportation over unreliable media, and is used in broadcast applications such as DVB and ATSC. It is contrasted with program stream, designed for more reliable media such as DVDs.

A packet is the basic unit of data in a transport stream. It consists of

1. a sync byte, whose value is 0x47,

2.followed by three one-bit flags and a 13-bit Packet Identifier (PID).

3.This is followed by a 4-bit continuity counter.

4.Additional optional transport fields, as signaled in the optional adaptation field, may follow.

5.The rest of the packet consists of payload.

Friday, March 6, 2009

莫尔斯码 (morse code)



ET, I Am Normal Man.
So U R Weird. Don't Keep Going Out.
He's Very Fond of Lazy et. Please Join BoXing Club. Yes, Zealously and Quietly.
E .

T #

I ..
A .#
N #.
M ##

S ...
U ..#
R .#.
W .##
D #..
K #.#
G ##.
O ###

H ....
V ...#
F ..#.
L .#..
P .##.
J .###
B #...
X #..#
C #.#.
Y #.##
Z ##..
Q ##.#

5 .....
4 ....#
3 ...##
2 ..###
1 .####
6 #....
7 ##...
8 ###..
9 ####.
0 #####

.   .#.#.#
,   ..##..

?  ..##..

!   ..##.
:   ###...
" .#..#.
'   .####.
=   #...#
THE QUICK BRMN FOX MJEUMPS OVER TSE LAZY DOG
- /. . . . / .
- -.- / . . - / . / - . - . / - . -
- . . . / . - . / - - - / . - - / - .
. . - . / - - - / - . . -
. - - - / . . - / - - / . - - . / . . .
- - - / . . . - / . / . - .
- / . . . . / .
. - . . / . - / - - . . / - . - -
- . . / - - - / - - .