Create & validate a signature

Hasonló dokumentumok
INDEXSTRUKTÚRÁK III.

(NGB_TA024_1) MÉRÉSI JEGYZŐKÖNYV

On The Number Of Slim Semimodular Lattices

Mapping Sequencing Reads to a Reference Genome

A modern e-learning lehetőségei a tűzoltók oktatásának fejlesztésében. Dicse Jenő üzletfejlesztési igazgató

Correlation & Linear Regression in SPSS

ANGOL NYELV KÖZÉPSZINT SZÓBELI VIZSGA I. VIZSGÁZTATÓI PÉLDÁNY

Alkalmazás-shop (Internet-kapcsolat szükséges)

Lexington Public Schools 146 Maple Street Lexington, Massachusetts 02420

A Karatbars marketingterve

STUDENT LOGBOOK. 1 week general practice course for the 6 th year medical students SEMMELWEIS EGYETEM. Name of the student:

2 level 3 innovation tiles. 3 level 2 innovation tiles. 3 level 1 innovation tiles. 2 tribe pawns of each color. 3 height 3 tribe pawns.

Ültetési és öntözési javaslatok. Planting and watering instructions

Construction of a cube given with its centre and a sideline

T Á J É K O Z T A T Ó. A 1108INT számú nyomtatvány a webcímen a Letöltések Nyomtatványkitöltő programok fülön érhető el.

Angol Középfokú Nyelvvizsgázók Bibliája: Nyelvtani összefoglalás, 30 kidolgozott szóbeli tétel, esszé és minta levelek + rendhagyó igék jelentéssel

Személyes adatváltoztatási formanyomtatvány- Magyarország / Personal Data Change Form - Hungary

1x1 Fordítóiroda 1x1 Translations

Csima Judit április 9.

Személyes adatváltoztatási formanyomtatvány - Magyarország / Personal Data Change Form - Hungary

Tudományos Ismeretterjesztő Társulat

Minősített tanúsítvány, visszavonási lista és időbélyeg profildefiníciók

Szakmai továbbképzési nap akadémiai oktatóknak december 14. HISZK, Hódmezővásárhely / Webex

ENROLLMENT FORM / BEIRATKOZÁSI ADATLAP

TestLine - Angol teszt Minta feladatsor

Lopocsi Istvánné MINTA DOLGOZATOK FELTÉTELES MONDATOK. (1 st, 2 nd, 3 rd CONDITIONAL) + ANSWER KEY PRESENT PERFECT + ANSWER KEY

SQL/PSM kurzorok rész

There is/are/were/was/will be

MATEMATIKA ANGOL NYELVEN

Széchenyi István Egyetem

Statistical Inference

Minősített tanúsítvány, visszavonási lista és időbélyeg profildefiníciók

Nemzetközi Kenguru Matematikatábor

FÖLDRAJZ ANGOL NYELVEN GEOGRAPHY

SQL- Utasítások csoportosítása Definíció: DDL: - objektum létrehozás CREATE - objektum megszüntetés DROP - objektum módosítás ALTER

Computer Architecture

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet Factor Analysis

KELER KSZF Zrt. bankgarancia-befogadási kondíciói. Hatályos: július 8.

Egészségügyi intézmények együttműködésének informatikai vonatkozásai. Fehér András

1. Gyakorlat: Telepítés: Windows Server 2008 R2 Enterprise, Core, Windows 7

Léptetőmotorok. Előnyök: Hátrányok:

9el[hW][e\L;BI IjWdZWhZi

Professional competence, autonomy and their effects

MATEMATIKA ANGOL NYELVEN

Tudományos Ismeretterjesztő Társulat

Rotary District 1911 DISTRICT TÁMOGATÁS IGÉNYLŐ LAP District Grants Application Form

DETAILED GUIDELINE Content Page

Operációs rendszerek Memóriakezelés 1.1

Ellenőrző lista. 2. Hálózati útvonal beállítások, kapcsolatok, névfeloldások ellenőrzése: WebEC és BKPR URL-k kliensről történő ellenőrzése.

AZ ACM NEMZETKÖZI PROGRAMOZÓI VERSENYE

MATEMATIKA ANGOL NYELVEN

USER MANUAL Guest user

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet Nonparametric Tests

OLYMPICS! SUMMER CAMP

ANNEX V / V, MELLÉKLET

first of all we would like to congratulate you for choosing one of the training of University Miskolc.

PIACI HIRDETMÉNY / MARKET NOTICE

ANGOL NYELV KÖZÉPSZINT SZÓBELI VIZSGA I. VIZSGÁZTATÓI PÉLDÁNY

2. Tavasz Kupa. Uszonyos és Búvárúszó Verseny Kiírása

Cashback 2015 Deposit Promotion teljes szabályzat

EXKLUZÍV AJÁNDÉKANYAGOD A Phrasal Verb hadsereg! 2. rész

Madonna novellái. 1. szint Július. Madonna képekkel illusztrált novelláskötetet(1) jelentet meg

Csatlakozás a BME eduroam hálózatához Setting up the BUTE eduroam network

KERESKEDELEM ISMERETEK ANGOL NYELVEN

Cloud computing. Cloud computing. Dr. Bakonyi Péter.

Directors and Officers Liability Insurance Questionnaire Adatlap vezetõ tisztségviselõk és felügyelõbizottsági tagok felelõsségbiztosításához

A 40 darab kapszulát tartalmazó Nespresso Pure Origin kávéválogatás ára: Ft

Cloud computing Dr. Bakonyi Péter.

Genome 373: Hidden Markov Models I. Doug Fowler

Go&Learn projekt. KIEGÉSZÍTŐ DOkUMENTUMOK 1. MELLÉKLET. Az LNMB és a VÁLLALKOZÁS közötti MEGÁLLAPODÁS

24th October, 2005 Budapest, Hungary. With Equal Opportunities on the Labour Market

discosnp demo - Peterlongo Pierre 1 DISCOSNP++: Live demo

Participation fee: HUF+VAT/person (Total: HUF/ person)

Laborgyakorlat: A Windows XP haladó telepítése

Lecture 11: Genetic Algorithms

Előszó.2. Starter exercises. 3. Exercises for kids.. 9. Our comic...17

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet. Correlation & Linear. Petra Petrovics.

Angol Nyelvvizsga Gyakorló Tesztgyűjtemény

MATEMATIKA ANGOL NYELVEN

First experiences with Gd fuel assemblies in. Tamás Parkó, Botond Beliczai AER Symposium

Utasítások. Üzembe helyezés

Word and Polygon List for Obtuse Triangular Billiards II

MATEMATIKA ANGOL NYELVEN

Teszt topológia E1/1 E1/0 SW1 E1/0 E1/0 SW3 SW2. Kuris Ferenc - [HUN] Cisco Blog -

(Asking for permission) (-hatok/-hetek?; Szabad ni? Lehet ni?) Az engedélykérés kifejezésére a következő segédigéket használhatjuk: vagy vagy vagy

PIACI HIRDETMÉNY / MARKET NOTICE

ANIMAL HEALTH CERTFICATE for the exportation of rodents from the Republic of Hungary to Japan

Cut-Off Time for Payment Orders, Incoming Payments And Fulfilment Orders

A. Hírek B. NEA C. Program D. Könyvajánló E. News in English F. A hírlevélről

Prémium WordPress havi jelentés

MATEMATIKA ANGOL NYELVEN

MATEMATIKA ANGOL NYELVEN

1. MINTAFELADATSOR KÖZÉPSZINT. Az írásbeli vizsga időtartama: 30 perc. III. Hallott szöveg értése

ANGOL NYELVI SZINTFELMÉRŐ 2008 A CSOPORT

MATEMATIKA ANGOL NYELVEN MATHEMATICS

ELEKTRONIKAI ALAPISMERETEK ANGOL NYELVEN

Contact us Toll free (800) fax (800)

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet. Nonparametric Tests. Petra Petrovics.

3. MINTAFELADATSOR KÖZÉPSZINT. Az írásbeli vizsga időtartama: 30 perc. III. Hallott szöveg értése

ELEKTRONIKAI ALAPISMERETEK ANGOL NYELVEN

Átírás:

IOTA TUTORIAL 7 Create & validate a signature v.0.0 KNBJDBIRYCUGVWMSKPVA9KOOGKKIRCBYHLMUTLGGAV9LIIPZSBGIENVBQ9NBQWXOXQSJRIRBHYJ9LCTJLISGGBRFRTTWD ABBYUVKPYFDJWTFLICYQQWQVDPCAKNVMSQERSYDPSSXPCZLVKWYKYZMREAEYZOSPWEJLHHFPYGSNSUYRZXANDNQTTLLZA MDVJVVJNTNPJBPTTPHLPMKBKDJAYKEQHDZPAZ9XOXMCJQUUXGTU9NBSUZQUXSSMYQCOLUUEXZZA9SGWDAELZJLNNZVMPT FTEPNHMKDMXMMHDAJIMKIDRCEKIXHEAEWKQNESBWGM9TULSPXKGSQXVRM9DRFARRGSUVGZNWOFCSSCTDTQORPKSAVTVW9 JIDQGQRJAAICYSWFFKSSPHX9NEJIHECEKOKLZ9NCWDENYFGYQLQKIZOPIZMNUOEKHIZBAVOTCT9PXOAKIWXUHFZDTNIGJ AYQKSTHEHMQZQGBQNJEHSTFEWDRBDOOSVVWKWEUEVDYSRMPJXPLDOGDBTXPNKYLBMYUWZFELTRUYKFLUPCVVQJZU9U9IM MTFKIHHTZJTCQEKKGKLONKDCIVOFAYFWZVAWKEJURHGOUXDMCRRGOFTTHXSIAVXLZZJIDLBVNBSYYZEH99ADGSPVLCVMU YUZMAJZC9IAGMURXUTRAPEM9ACHQYSLJGT9LXMODDJTVIH9MPF9BNSLGXUDG9VURODUSNJSRRYCSRRFJCAYRDUP9KCZCQ GIKQHQRIWSLHPTUTDDCREZMECPTQBTJRIQUFPGAGCOJCUUJZVEWICYZZBJUROCRWOLRUOPRMXBCIFFTWHEEJRJNUXMYZW WZ9ITBLYRXCMSDUTWICX9VXTJPDGUJPILVFKDZLCJKHWCSMC9WFYSH9JKJGQBHRSKNAONLMPTKPEXKCPLXOSNCRVSCXGR PZMNALCYLRMMGJHBLCMWQPYEYPREMEIBNYEHFUKHLOVXLPIUUQPLAUZNDRMTXMZUQABEM9MNV9ILLMSMFHHJCDBJ9FXDS LWIJYFKHKEEQGSYWIHHLZQORCLVVHWIUGDEXSYWXXGSUHHJNJBFHAXGSQMSOCUZZQW9JNJVTYDJAM9YWNDAOLZPPWAFOY NJPIDRSJVQTMTBRPIP999SKIEUK9IPP9QHOZIFIVBRPXPBBWOIOJKXY9ZMZEOXTB9NVTHUWGSEIJEIMTXDAHEABRKWRLN KNBJDBIRYCUGVWMSKPVA9KOOGKKIRCBYHLMUTLGGAV9LIIPZSBGIENVBQ9NBQWXOXQSJRIRBHYJ9LCTJLISGGBRFRTTWD

INTRO In this video I will explain how a signature is created and validated.

HOW AN ADDRESS IS CALCULATED Before I explain how a signature in a bundle is created and validated, it is important to understand how IOTA addresses are calculated. In IOTA tutorial 9., I have explained in detail how the key, digests and address are created. Here is a short explanation: A key (= private key) is generated using the seed, index number and security level. The index number is an integer (0,,2. 90079925474099) and every address has a corresponding index number.

HOW AN ADDRESS IS CALCULATED The generated key is divided in segments of 8 trytes each. Depending on the selected security level (,2 or 3) you will have (x27=) 27, (2x27=) 54 or (3x27=) 8 segments. Each key segment is hashed 26 times. 27 key segments together forms a keyfragment and each keyfragment is hashed one time to create a digests. Depending on the selected security level,, 2 or 3 digests are combined together. The combined digests are hashed one time to create the address.

CALCULATE ADDRESS Seed, index number, security level key key Fragment 0 25 26 0 25 26 0 25 26 26 26 26 26 26 26 26 26 26 26 26 26 segment each segment consists of 8 trytes hash each 0 25 26 0 25 26 0 25 26 segment K times digests security level 3 security level 2 security level 0 2 27 segments forms a keyfragment hash each keyfragment x each digests consists of 8 trytes address address address hash n digests x

HOW A SIGNATURE IS CREATED The generated key is divided in segments of 8 trytes each. Depending on the selected security level (,2 or 3) you will have (x27=) 27, (2x27=) 54 or (3x27=) 8 segments. To create a signature: Calculate the normalizedbundlehash = normalizedbundle(bundlehash) The bundlehash is explained in IOTA tutorial 5. The normalizedbundlehash is explained in IOTA tutorial 6. Convert each tryte in the normalizedbundlehash to its decimal value.

HOW A SIGNATURE IS CREATED Apply for each decimal value the following calculation: K = 3 - decimal value. Each key segment must be hashed K times. Combine the 27 hashed key segments to a signaturefragment. A signaturefragment has (27x8=) 287 trytes. Depending on the selected security level you will have, 2 or 3 signaturefragments. A transactionobject stores a signaturefragment in the signaturemessagefragment field. This field size is 287 trytes. Additional transactionobjects are needed to store the remaining signaturefragments. Note: signaturemessagefragments is the same as signaturefragments.

Seed, index number, security level key signature Fragment 0 25 26 0 25 26 0 25 26 26 23 3 2 23 9 20 5 25 20 23 0 25 26 0 25 26 0 25 26 segment each segment consists of 8 trytes hash each segment K times key Fragment 6 25 3 0 3 3 4 3 7 6 fragment stored in bundle hash each 0 25 26 0 25 26 0 25 26 segment K times digests security level 3 security level 2 security level 0 2 27 segments forms a keyfragment hash each keyfragment x each digests consists of 8 trytes address address address hash n digests x

CALCULATE NUMBER OF HASHES bundlehash 8 trytes R T L Q Z T 9 A W U C Y normalized normalized O T L Q BundleHash N Q 9 A Q U T Y BundleFragment 27 trytes tryte decimal value -2-7 2-0 -3-0 0-0 -6-7 -2 K = 3 - decimal 25 20 23 26 23 3 2 23 9 20 5 K times to hash each segment to CREATE signaturefragment K = 3 + decimal 6 25 3 0 3 3 4 3 7 6 K times to hash each segment to VALIDATE signaturefragment

HOW A SIGNATURE IS VALIDATED To validate a signature in a transaction bundle: Extract all corresponding signaturemessagefragments from the bundle. Depending on the selected security level you will have, 2 or 3 signaturemessagefragments. The combined signaturemessagefragments is called the signature. Extract the bundlehash from the bundle. Note: The bundlehash value is the same within the bundle.

TRANSACTIONOBJECT EXAMPLE PART OF 2 A transactionobject in a bundle (security level 2). { "hash": "YDDQ...A9999", "signaturemessagefragment": "JHAK...MVGY", "address": "HRKD...XKHX", "value": -3, "obsoletetag": "999999999999999999999999999", "timestamp": 55494426, "currentindex":, "lastindex": 2, 287 trytes }, "bundle": "RTGX...LQCY", "trunktransaction": "WVCLP...99999", "branchtransaction": "DOXV...X999", "tag": "999999999999999999999999999", "attachmenttimestamp": 5549657334, "attachmenttimestamplowerbound": 0, "attachmenttimestampupperbound": 382798742493, "nonce": "AZ999IOB9999999999999999999", "persistence": true 8 trytes

TRANSACTIONOBJECT EXAMPLE PART 2 OF 2 A transactionobject in a bundle (security level 2). { "hash": "WVCL...OUCPM", "signaturemessagefragment": "ZRUE...AWFY", "address": "HRKD...XKHX", "value": 0, "obsoletetag": "999999999999999999999999999", "timestamp": 55494426, "currentindex": 2, "lastindex": 2, 287 trytes }, "bundle": "RTGX...LQCY", "trunktransaction": "WVCLP...99999", "branchtransaction": "DOXV...X999", "tag": "999999999999999999999999999", "attachmenttimestamp": 5549656769, "attachmenttimestamplowerbound": 0, "attachmenttimestampupperbound": 382798742493, "nonce": JA999ISA9999999999999999999", "persistence": true 8 trytes

Seed, index number, security level key signature Fragment 0 25 26 0 25 26 0 25 26 26 23 3 2 23 9 20 5 25 20 23 0 25 26 0 25 26 0 25 26 segment each segment consists of 8 trytes hash each segment K times key Fragment 6 25 3 0 3 3 4 3 7 6 fragment stored in bundle hash each 0 25 26 0 25 26 0 25 26 segment K times digests security level 3 security level 2 security level 0 2 27 segments forms a keyfragment hash each keyfragment x each digests consists of 8 trytes address address address hash n digests x

HOW A SIGNATURE IS VALIDATED Validate a signature. https://github.com/iotaledger/iota.lib.js/blob/v0.4.7/lib/crypto/signing/signing.js var validatesignatures = function(expectedaddress, signaturefragments, bundlehash)

HOW A SIGNATURE IS VALIDATED A signature consists of,2 or 3 signaturemessagefragments (= signaturefragments), depending on the selected security level. To validate a signature: Calculate the normalizedbundlehash = normalizedbundle(bundlehash) Convert each tryte in the normalizedbundlehash to its decimal value. Apply for each decimal value the following calculation: K = 3 + decimal value. Each signaturefragment segment must be hashed K times.

HOW A SIGNATURE IS VALIDATED Combine the 27 hashed signaturefragment segments to a keyfragment. A keyfragment has (27x8=) 287 trytes. Each keyfragment is hashed one time to create a digests. Depending on the selected security level,, 2 or 3 digests are combined together. The combined digests are hashed one time to create the address. If this calculated address is the same as the address taken from the transactionobject in the bundle, than the signature is valid.

CALCULATE NUMBER OF HASHES bundlehash 8 trytes R T L Q Z T 9 A W U C Y normalized normalized O T L Q BundleHash N Q 9 A Q U T Y BundleFragment 27 trytes tryte decimal value -2-7 2-0 -3-0 0-0 -6-7 -2 K = 3 - decimal 25 20 23 26 23 3 2 23 9 20 5 K times to hash each segment to CREATE signaturefragment K = 3 + decimal 6 25 3 0 3 3 4 3 7 6 K times to hash each segment to VALIDATE signaturefragment

CREATE AND VALIDATE SIGNATUREFRAGMENT Create signaturefragment. https://github.com/iotaledger/iota.lib.js/blob/v0.4.7/lib/crypto/signing/signing.js var signaturefragment = function(normalizedbundlefragment, keyfragment) Validate signaturefragment. https://github.com/iotaledger/iota.lib.js/blob/v0.4.7/lib/crypto/signing/signing.js var validatesignatures = function(expectedaddress, signaturefragments, bundlehash) var digest = function(normalizedbundlefragment, signaturefragment)

CREATE AND VALIDATE A SIGNATURE Creating a signature Validating a signature key 0 fragment0 25 26 normalizedbundlefragment0 (27 trytes) signaturefragment0 0 25 26 25 20 23 25 26 tryte decimal O T L Q -2-7 2-0 K = 3 - dec 25 20 23 6 25 3 25 26 0 keyfragment0 0 signaturefragment0 Security level tryte decimal normalizedbundlefragment0 (27 trytes) O T L Q -2-7 2-0 K = 3 + dec 6 25 3 0 address

IOTA TRYTE ALPHABET Trits Dec Tryte Trits Dec Tryte 0, 0, 0 0 9, 0, 0 A -,-,- -3 N -,, 0 2 B 0,-,- -2 O 0,, 0 3 C,-,- - P,, 0 4 D -, 0,- -0 Q -,-, 5 E 0, 0,- -9 R 0,-, 6 F, 0,- -8 S,-, 7 G -,,- -7 T -, 0, 8 H 0,,- -6 U 0, 0, 9 I,,- -5 V, 0, 0 J -,-, 0-4 W -,, K 0,-, 0-3 X 0,, 2 L,-, 0-2 Y,, 3 M -, 0, 0 - Z