Download presentation
Presentation is loading. Please wait.
1
Q&A TGEL Group 3/2009
2
SelectorGadget http://www.selectorgadget.com/
3
Map lab_controller.rb def gmap @marks= [ {:lat=>13.862222, :lng=>100.513333, :title=>' เมือง '}, {:lat=>13.805, :lng=>100.47277, :title=>' บางกรวย '}, {:lat=>13.876667, :lng=>100.403889, :title=>' บางใหญ่ '}, {:lat=>13.916944, :lng=>100.421389, :title=>' บางบัวทอง '}, {:lat=>13.9889, :lng=>100.31361, :title=>' ไทรน้อย '}, {:lat=>13.9125, :lng=>100.49833, :title=>' ปากเกร็ด '} ] end
4
Map (1) <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> function initialize() { var latLng = new google.maps.LatLng(13.8, 100.5); var map = new google.maps.Map( document.getElementById('mapCanvas'), { zoom: 11, center: latLng, mapTypeId: google.maps.MapTypeId.ROADMAP });
5
Map (2) var image= '/images/home.gif'; var latLng = new google.maps.LatLng(, ); var marker = new google.maps.Marker({ position: latLng, title: ' ', map: map, draggable: true, icon: image }); } google.maps.event.addDomListener(window, 'load', initialize);
6
Map (3) #mapCanvas { width: 500px; height: 500px; }
7
Charts http://code.google.com/apis/visualization/doc umentation/gallery.html http://code.google.com/apis/visualization/doc umentation/gallery.html
8
Google Visualization (1) google.load("visualization", "1", {packages:["linechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', ' ปี '); data.addColumn('number', ' จำนวนเรื่องร้องเรียน '); data.addColumn('number',' ดำเนินการแล้ว '); data.addRows(3); data.setValue(0, 0, '2550'); data.setValue(0, 1, 1000); data.setValue(0, 2, 400); data.setValue(1, 0, '2551'); data.setValue(1, 1, 1170); data.setValue(1, 2, 460); data.setValue(2, 0, '2552'); data.setValue(2, 1, 860); data.setValue(2, 2, 580);
9
Google Visualization (2) var chart = new google.visualization.LineChart( document.getElementById('chart_div')); chart.draw(data, {width: 500, height: 300, legend: 'bottom', title: ' ทดสอบ Google Visualization'}); }
10
PKI
11
Asymmetric Encryption Example Dear Carol: I think Alice is having an affair with Bob. I need to see you right always. Love, Ted Dear Carol: I think Alice is having an affair with Bob. I need to see you right always. Love, Ted Ted Carol encryptdecrypt Carol's Private Key Carol's Public Key 011100111001001 110011100111001 001110000111111 ciphertext
12
Asymmetric Non-Repudiation Dear Ted: Please leave me alone or I will contact a lawyer. I do not care about your personal life. Carol Ted Carol decrypt Carol's Public Key Dear Ted: Please leave me alone or I will contact a lawyer. I do not care about your personal life. Carol Carol's Private Key encrypt 011100111001001 110011100111001 001110000111111 ciphertext
13
Digital Signature Creation Dear Mr. Ted: We have asked the Court to issue a restraining order against you to stay away from Carol. Sincerely, Sue Yew Dewey, Cheatam & Howe, Law Firm Dear Mr. Ted: We have asked the Court to issue a restraining order against you to stay away from Carol. Sincerely, Sue Yew Dewey, Cheatam & Howe, Law Firm encrypt Sue's Private Key Hash Function Sue 0F47CEFF AE0317DB AA567C29 Hash Value 0101011110000110101 1011110101111010111 Digital Signature
14
Digital Signature Validation Dear Mr. Ted: We have asked the Court to issue a restraining order against you to stay away from Carol. Sincerely, Sue Yew Dewey, Cheatam & Howe, Law Firm 0101011110000110101 1011110101111010111 Sue's Public Key decrypt 0F47CEFF AE0317DB AA567C29 0F47CEFF AE0317DB AA567C29 Signature is valid if the two hashes match
15
lab: PKI gem install ezcrypto copy key.rb into lib/ copy songrit.key, songrit.pub into public/
16
lab_controller.rb def test_pki require 'key' require 'ezcrypto' priv_key = Crypto::Key.from_file('public/songrit.key') pub_key = Crypto::Key.from_file('public/songrit.pub') f= File.read('README') digest= EzCrypto::Digester.digest64(f) t = [" digest #{digest}"] secret = priv_key.encrypt(digest) t encrypt using private key #{secret}" decrypt= pub_key.decrypt(secret) t decrypt using public key #{decrypt}" t " render :text=> t.join(" ") end
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.