Code Monkey home page Code Monkey logo

branca-php's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

branca-php's Issues

64-bit format codes are not available for 32-bit versions of PHP

Dear Tuupola,

First of all, thank you for all your great work. I'm currently implementing a REST api using branca-middleware. I haven't touched my code since one month and I experienced an issue with sodium_compat library. I assume it's not an issue with Branca library but I'm just curious about this change.

Apparently, we need a 64 bit version of php to encode payload. Here is the error message than occur when I try to encode payload :

pack(): 64-bit format codes are not available for 32-bit versions of PHP

E:\Utilisateurs\Dropbox\brancatest\vendor\paragonie\sodium_compat\src\Core\Util.php:656
E:\Utilisateurs\Dropbox\brancatest\vendor\paragonie\sodium_compat\src\Crypto32.php:298
E:\Utilisateurs\Dropbox\brancatest\vendor\paragonie\sodium_compat\src\Crypto32.php:362
E:\Utilisateurs\Dropbox\brancatest\vendor\paragonie\sodium_compat\src\Compat.php:732
E:\Utilisateurs\Dropbox\brancatest\vendor\tuupola\branca\src\Branca.php:55

I have build a minimalistic test to reproduce this issue/change :
Error test

I'm currently learning php, so I probably miss something relevant.

64-bit versions of PHP is now required to work with Branca ?

Is timestamp a security risk?

Is timestamp a security risk? Ie. should there be another version without timestamp in header. Currently it is possible to opt out by passing a 0 or false as timestamp. This still wastes a few bytes per request.

Add ability to not throw RuntimeException just return 'false' on decipherer failure

First of all, nice job with Branca-php lib, now the "issue".

  1. Branca-php uses error messages which cannot be translated. I cannot wrap them to translation function because they are hardcoded.
  2. In my CMS, I set custom exception_handler [When exception is thrown, user only see message "Please report error with IDxxxxx" and the error is saved to DB]. In case of Branca's decipherer failure I want to display some better message to user, which I cannot thanks to my custom exception_handler.

This is the question:

Can you add config which disables RuntimeExceptions and just returns 'false' when decipherer operation fails? Something like:

$branca = new Branca( "supersecretkeyyoushouldnotcommit", false );

This solves both points.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.