elective-stereophonic
elective-stereophonic
nxtlib-php, five functions to allow easy nxt integration singapore
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Nxt Client: Nxt 1.11.15

Author Topic: nxtlib-php, five functions to allow easy nxt integration  (Read 2668 times)

jones

  • Hero Member
  • *****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
nxtlib-php, five functions to allow easy nxt integration
« on: February 14, 2015, 03:35:49 am »

As suggested by Damelon, and required by another project I want to work on, I have created this library.

https://github.com/jonesnxt/nxtlib-php

It is split up into three different classes -

class Curve25519:
There wasn't an implementation for a standalone curve25519 ECDH in PHP, so I ended up having to make my own :) ported from the js version in the nxt client

class Converters:
Conversion functions for changing between data types and creating public and private keys to use with curve25519

class Nxtlib:
Where the fun stuff happens, contains the objects curve, for curve25519, and convert, for converters, as well as some additional necesarry functions.
To initialize you need to include the ip of the node you want to connect to.
functions of Nxtlib:
- request($requestType, $params)
- signBytes($message, $secretPhrase)
- verifyBytes($signature, $message, $publicKey)
- generateToken($websiteString, $secretPhrase)
- parseToken($tokenString, $website)

with node requests, signing and verifying bytes with curve25519, and generating and parsing tokens, nxt can be integrated into a web service fairly easily.
Licensed with MIT licence, use however you'd like :)
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY

mystcoin

  • Full Member
  • ***
  • Karma: +50/-0
  • Offline Offline
  • Posts: 188
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #1 on: February 14, 2015, 07:47:28 am »

Very nice! Thank you.
Logged

crimi

  • Hero Member
  • *****
  • Karma: +122/-11
  • Offline Offline
  • Posts: 863
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #2 on: February 14, 2015, 10:45:13 am »

Really useful the entry level(php) for bruteforcing accounts gets easier now, those darknxt shell be not lost forever.  ;)
Logged

Tosch110

  • Ex-Staff Member
  • Hero Member
  • *****
  • Karma: +211/-18
  • Offline Offline
  • Posts: 2365
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #3 on: February 14, 2015, 11:26:06 am »

jones you are awesome :D our ideas cross many times, I was just about to work on a curve25519 implementation on PHP. Nice that you share this! Many thanks, I will look into this!

Daedelus

  • Hero Member
  • *****
  • Karma: +230/-12
  • Offline Offline
  • Posts: 3280
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #4 on: February 16, 2015, 05:15:32 pm »

Really useful the entry level(php) for bruteforcing accounts gets easier now, those darknxt shell be not lost forever.  ;)

Can you expand on this?
Logged
NXT: NXT-4CS7-S4N5-PTH5-A8R2Q

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #5 on: February 16, 2015, 05:29:00 pm »

Really useful the entry level(php) for bruteforcing accounts gets easier now, those darknxt shell be not lost forever.  ;)

Can you expand on this?
maybe more coders can do this, but really the C implementation should be much faster than php and a GPU version much faster than C
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

Tosch110

  • Ex-Staff Member
  • Hero Member
  • *****
  • Karma: +211/-18
  • Offline Offline
  • Posts: 2365
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #6 on: February 16, 2015, 05:32:35 pm »

Really useful the entry level(php) for bruteforcing accounts gets easier now, those darknxt shell be not lost forever.  ;)

Can you expand on this?

I have not tested it yet. But I think with this Curve25519 library you can create a Nxt account with PHP, not required to connect to Nxt?

So you check out which passphrase leads to which accounts, you can check the Nxt network if there are any funds in it. This does not enable anything what has not been possible before. But as crimi said, might lower the entry level to bruteforce

Daedelus

  • Hero Member
  • *****
  • Karma: +230/-12
  • Offline Offline
  • Posts: 3280
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #7 on: February 16, 2015, 05:35:21 pm »

Do we have a new way for bruteforcing? I thought the way people were doing was found to be fundamentally flawed by Evil Knievel, IIRC
Logged
NXT: NXT-4CS7-S4N5-PTH5-A8R2Q

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #8 on: February 16, 2015, 05:38:55 pm »

Do we have a new way for bruteforcing? I thought the way people were doing was found to be fundamentally flawed by Evil Knievel, IIRC
on recent CPU core's the standard curve25519 lib can test almost a million addresses
GPU version I assume a lot more
but 64 bit space is not as small as it sounds
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

crimi

  • Hero Member
  • *****
  • Karma: +122/-11
  • Offline Offline
  • Posts: 863
    • View Profile
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #9 on: February 16, 2015, 07:26:19 pm »

Really useful the entry level(php) for bruteforcing accounts gets easier now, those darknxt shell be not lost forever.  ;)

Can you expand on this?
maybe more coders can do this, but really the C implementation should be much faster than php and a GPU version much faster than C
+1
Thats what i meant with it.
Logged

jones

  • Hero Member
  • *****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
Re: nxtlib-php, five functions to allow easy nxt integration
« Reply #10 on: February 16, 2015, 07:35:23 pm »

Do we have a new way for bruteforcing? I thought the way people were doing was found to be fundamentally flawed by Evil Knievel, IIRC
on recent CPU core's the standard curve25519 lib can test almost a million addresses
GPU version I assume a lot more
but 64 bit spaaace is not as small as it sounds

yeah, 2^64 gives us a number around the order of 1e19 which is arbitrarily large, given that there are only a few hundered nxt accounts with positive balances and no public key, 300/2^64 is a 1.6e-17 chance of brute forcing per account you check, that gives us about 6.1e16 different accounts before we find one that we can steal. Put into computer terms, it would take a computer that could process 100 million accounts per second roughly 19.5 years to find any dark nxt.

The only downside to 64 bit security is the birthday problem, this tells us that if we are able to hold a large amount of passphrases and compare all of the account id's together, the number needed to find a collision (two passphrases with the same accountid) is largely reduced (the square root of), so sqrt(2^64) is the chance of collision with the birthday attack factored in, giving us 2^32, which is only a little over 4 billion, lets break out that same 100 million accounts per second but now compare to previous accounts to find a collision, it would only take 42 seconds to do this. (and I have heard its been done)

so brute forcing won't do much good, especially when you have a public key, 2^256 has an order only slightly smaller than the total number of particles in the observable universe (unless you have a quantum computer, then you have other problems)
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY
 

elective-stereophonic
elective-stereophonic
assembly
assembly