Can I use only one table field to store BCrypt cost, salt, and hash value for WildFly?












0















The example on http://planet.jboss.org/post/using_a_database_to_authenticate_and_authorize_your_users_in_elytron uses three separate fields and index mapping:



<principal-query sql="SELECT A.PASSWORD, A.SALT_VALUE, A.ITERATION_COUNT FROM USERS A WHERE A.USER_NAME = LOWER(?)" data-source="myDS">

<bcrypt-mapper password-index="1" salt-index="2" iteration-count-index="3"/>

</principal-query>


Does WildFly JDBC also support a BCrypt hash field which stores the BCrypt as a single string like



$2a$16$lvPZugycIDUYhER7eyyyouFTIwyk/ZVighN7RbDqkLcIfMnu0Cqi6


where cost and hash are already contained in the string?



Or do I have to cut the string into its parts and store them in separate fields so that WildFly can access them separately?



--



From the first comment to this related question:




It's also how passwords are saved on UNIX-type systems where there is
a singular field for storing the hashed password. The string includes
information on the hashing method, the salt, and the hash according to
a fairly standard format. That way if you change hashing methods in
the future, your older hashed passwords will still work.











share|improve this question





























    0















    The example on http://planet.jboss.org/post/using_a_database_to_authenticate_and_authorize_your_users_in_elytron uses three separate fields and index mapping:



    <principal-query sql="SELECT A.PASSWORD, A.SALT_VALUE, A.ITERATION_COUNT FROM USERS A WHERE A.USER_NAME = LOWER(?)" data-source="myDS">

    <bcrypt-mapper password-index="1" salt-index="2" iteration-count-index="3"/>

    </principal-query>


    Does WildFly JDBC also support a BCrypt hash field which stores the BCrypt as a single string like



    $2a$16$lvPZugycIDUYhER7eyyyouFTIwyk/ZVighN7RbDqkLcIfMnu0Cqi6


    where cost and hash are already contained in the string?



    Or do I have to cut the string into its parts and store them in separate fields so that WildFly can access them separately?



    --



    From the first comment to this related question:




    It's also how passwords are saved on UNIX-type systems where there is
    a singular field for storing the hashed password. The string includes
    information on the hashing method, the salt, and the hash according to
    a fairly standard format. That way if you change hashing methods in
    the future, your older hashed passwords will still work.











    share|improve this question



























      0












      0








      0








      The example on http://planet.jboss.org/post/using_a_database_to_authenticate_and_authorize_your_users_in_elytron uses three separate fields and index mapping:



      <principal-query sql="SELECT A.PASSWORD, A.SALT_VALUE, A.ITERATION_COUNT FROM USERS A WHERE A.USER_NAME = LOWER(?)" data-source="myDS">

      <bcrypt-mapper password-index="1" salt-index="2" iteration-count-index="3"/>

      </principal-query>


      Does WildFly JDBC also support a BCrypt hash field which stores the BCrypt as a single string like



      $2a$16$lvPZugycIDUYhER7eyyyouFTIwyk/ZVighN7RbDqkLcIfMnu0Cqi6


      where cost and hash are already contained in the string?



      Or do I have to cut the string into its parts and store them in separate fields so that WildFly can access them separately?



      --



      From the first comment to this related question:




      It's also how passwords are saved on UNIX-type systems where there is
      a singular field for storing the hashed password. The string includes
      information on the hashing method, the salt, and the hash according to
      a fairly standard format. That way if you change hashing methods in
      the future, your older hashed passwords will still work.











      share|improve this question
















      The example on http://planet.jboss.org/post/using_a_database_to_authenticate_and_authorize_your_users_in_elytron uses three separate fields and index mapping:



      <principal-query sql="SELECT A.PASSWORD, A.SALT_VALUE, A.ITERATION_COUNT FROM USERS A WHERE A.USER_NAME = LOWER(?)" data-source="myDS">

      <bcrypt-mapper password-index="1" salt-index="2" iteration-count-index="3"/>

      </principal-query>


      Does WildFly JDBC also support a BCrypt hash field which stores the BCrypt as a single string like



      $2a$16$lvPZugycIDUYhER7eyyyouFTIwyk/ZVighN7RbDqkLcIfMnu0Cqi6


      where cost and hash are already contained in the string?



      Or do I have to cut the string into its parts and store them in separate fields so that WildFly can access them separately?



      --



      From the first comment to this related question:




      It's also how passwords are saved on UNIX-type systems where there is
      a singular field for storing the hashed password. The string includes
      information on the hashing method, the salt, and the hash according to
      a fairly standard format. That way if you change hashing methods in
      the future, your older hashed passwords will still work.








      java authentication wildfly bcrypt






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 22 '18 at 12:15







      mjn42

















      asked Nov 22 '18 at 10:24









      mjn42mjn42

      499316




      499316
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53428798%2fcan-i-use-only-one-table-field-to-store-bcrypt-cost-salt-and-hash-value-for-wi%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53428798%2fcan-i-use-only-one-table-field-to-store-bcrypt-cost-salt-and-hash-value-for-wi%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

          Npm cannot find a required file even through it is in the searched directory