PEG API Auditing — Factomize

The Data

Interpreting the Data

Scenario A: Individual Manipulation

Scenario B: Complete Manipulation

Scenario C: Exchange Manipulation

PNMC vs Factoshi

Example Verification

chain, _ := hex.DecodeString("843dbee7a49a9b9510d399759fbce24b1f700268c94508085abce352d70ed1f6") timestamp := []byte("1576061423") content := []byte(`{"Factoshi":"{\"price\":0.0034144444,\"updated_at\":1576061416,\"quote\":\"USD\",\"base\":\"PEG\"}","PNMC":"{\"ticker_symbol\":\"PEG\",\"exchange_price\":\"0.00341280\",\"exchange_price_dateline\":1576061415}"}`) pubkey, _ := hex.DecodeString("90a5ad85e62dbc535f98c424429a3ea6e285538231ab1324136403cbdc459ae1") signature, _ := hex.DecodeString("7c7b9273681ecac228c6548e341163d972d3e13215b97f9a3ca8f4f4b1c4cd272a00464afec32b2de0f34c95620857f521485594d530720b6afa46b942b05804") // build the data for the signature data := chain data = append(data, timestamp...) data = append(data, content...) // verify the signature fmt.Println("Signature valid?", ed25519.Verify(pubkey, data, signature)) // verify the time fmt.Println("Local timezone:", time.Unix(1576061423, 0)) fmt.Println(" UTC:", time.Unix(1576061423, 0).UTC())
Signature valid? true Local timezone: 2019-12-11 11:50:23 +0100 CET UTC: 2019-12-11 10:50:23 +0000 UTC

Example Comparison

{"PEG":"0.00335991","pADA":"0.03689946","pBNB":"15.00111626","pBRL":"0.24119482","pCAD":"0.7553897","pCHF":"1.01509445","pCNY":"0.14203944","pDASH":"50.52701026","pDCR":"20.00270541","pETH":"146.43893541","pEUR":"1.10802096","pFCT":"2.80600488","pGBP":"1.31450955","pHKD":"0.12800409","pINR":"0.01410924","pJPY":"0.00920175","pKRW":"0.00083683","pLTC":"44.62245885","pMXN":"0.05196829","pPHP":"0.01967516","pRVN":"0.02607645","pSGD":"0.73538604","pUSD":"1","pXAG":"16.68947561","pXAU":"1466.27565982","pXBC":"208.31591893","pXBT":"7269.33948649","pXLM":"0.05370935","pXMR":"53.5554196","pZEC":"31.08442599"}

The App

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store