Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7609443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:10:21+00:00 2026-05-31T01:10:21+00:00

I am trying to get hash of password using Botan’s function generate_bcrypt(). I read

  • 0

I am trying to get hash of password using Botan’s function generate_bcrypt().

I read manual http://botan.randombit.net/passhash.html here. Afterwards I have read it yet once.
Source code:

#include <botan/botan.h>
#include <botan-1.10/botan/bcrypt.h>
#include <stdio.h>
#include <iostream>

 using namespace Botan;

 int main(int argc, char *argv[])
 {
   LibraryInitializer init;

   std::string passw="12dnblkndlnbfndlknblf";
   AutoSeeded_RNG rng;


    std::string str= generate_bcrypt(passw,rng,12);

   } 

I compiled it successfully, but when I run it I am getting:

     Starting /home/sh/qt/test-build-desktop/test...
      *** stack smashing detected ***: /home/sh/qt/test-build-desktop/test terminated
      ======= Backtrace: =========
  /lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0x7618d5]
/lib/i386-linux-gnu/libc.so.6(+0xe7887)[0x761887]
/usr/local/lib/libbotan-1.10.so.0(+0x2517a1)[0xd957a1]

/usr/local/lib/libbotan-1.10.so.0(_ZN5Botan8Blowfish16eks_key_scheduleEPKhjS2_j+0x17d)[0xbcb52d]
[0xbfb64f4c]
======= Memory map: ========
00110000-00127000 r-xp 00000000 08:07 17853      /lib/i386-linux-gnu/libpthread-2.13.so
00127000-00128000 r--p 00016000 08:07 17853      /lib/i386-linux-gnu/libpthread-2.13.so
00128000-00129000 rw-p 00017000 08:07 17853      /lib/i386-linux-gnu/libpthread-2.13.so
00129000-0012b000 rw-p 00000000 00:00 0 
0012b000-00147000 r-xp 00000000 08:07 17835      /lib/i386-linux-gnu/libgcc_s.so.1
00147000-00148000 r--p 0001b000 08:07 17835      /lib/i386-linux-gnu/libgcc_s.so.1
00148000-00149000 rw-p 0001c000 08:07 17835      /lib/i386-linux-gnu/libgcc_s.so.1
00149000-00158000 r-xp 00000000 08:07 21570      /lib/libbz2.so.1.0.4
00158000-00159000 r--p 0000e000 08:07 21570      /lib/libbz2.so.1.0.4
00159000-0015a000 rw-p 0000f000 08:07 21570      /lib/libbz2.so.1.0.4
0015a000-001c8000 r-xp 00000000 08:07 212988     /usr/lib/libgmp.so.10.0.1
001c8000-001c9000 r--p 0006d000 08:07 212988     /usr/lib/libgmp.so.10.0.1
001c9000-001d0000 rw-p 0006e000 08:07 212988     /usr/lib/libgmp.so.10.0.1
001d0000-001d7000 r-xp 00000000 08:07 17855      /lib/i386-linux-gnu/librt-2.13.so
001d7000-001d8000 r--p 00006000 08:07 17855      /lib/i386-linux-gnu/librt-2.13.so
001d8000-001d9000 rw-p 00007000 08:07 17855      /lib/i386-linux-gnu/librt-2.13.so
001d9000-001ec000 r-xp 00000000 08:07 17267      /lib/i386-linux-gnu/libz.so.1.2.3.4
001ec000-001ed000 r--p 00012000 08:07 17267      /lib/i386-linux-gnu/libz.so.1.2.3.4
001ed000-001ee000 rw-p 00013000 08:07 17267      /lib/i386-linux-gnu/libz.so.1.2.3.4
001ee000-001f1000 r-xp 00000000 08:07 17842      /lib/i386-linux-gnu/libdl-2.13.so
001f1000-001f2000 r--p 00002000 08:07 17842      /lib/i386-linux-gnu/libdl-2.13.so
001f2000-001f3000 rw-p 00003000 08:07 17842      /lib/i386-linux-gnu/libdl-2.13.so
00214000-00232000 r-xp 00000000 08:07 17836      /lib/i386-linux-gnu/ld-2.13.so
00232000-00233000 r--p 0001d000 08:07 17836      /lib/i386-linux-gnu/ld-2.13.so
00233000-00234000 rw-p 0001e000 08:07 17836      /lib/i386-linux-gnu/ld-2.13.so
00234000-00312000 r-xp 00000000 08:07 666277     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00312000-00313000 ---p 000de000 08:07 666277     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00313000-00317000 r--p 000de000 08:07 666277     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00317000-00318000 rw-p 000e2000 08:07 666277     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
00318000-0031f000 rw-p 00000000 00:00 0 
0031f000-004ac000 r-xp 00000000 08:07 16477      /lib/i386-linux-gnu/libcrypto.so.1.0.0
004ac000-004ba000 r--p 0018c000 08:07 16477      /lib/i386-linux-gnu/libcrypto.so.1.0.0
004ba000-004c0000 rw-p 0019a000 08:07 16477      /lib/i386-linux-gnu/libcrypto.so.1.0.0
004c0000-004c3000 rw-p 00000000 00:00 0 
004c3000-004eb000 r-xp 00000000 08:07 17843      /lib/i386-linux-gnu/libm-2.13.so
004eb000-004ec000 r--p 00028000 08:07 17843      /lib/i386-linux-gnu/libm-2.13.so
004ec000-004ed000 rw-p 00029000 08:07 17843      /lib/i386-linux-gnu/libm-2.13.so
0067a000-007f0000 r-xp 00000000 08:07 17839      /lib/i386-linux-gnu/libc-2.13.so
007f0000-007f2000 r--p 00176000 08:07 17839      /lib/i386-linux-gnu/libc-2.13.so
007f2000-007f3000 rw-p 00178000 08:07 17839      /lib/i386-linux-gnu/libc-2.13.so
007f3000-007f6000 rw-p 00000000 00:00 0 
0088c000-00b2a000 r-xp 00000000 08:07 214999     /usr/lib/libbotan-1.8.13.so
00b2a000-00b36000 r--p 0029d000 08:07 214999     /usr/lib/libbotan-1.8.13.so
00b36000-00b37000 rw-p 002a9000 08:07 214999     /usr/lib/libbotan-1.8.13.so
00b44000-00e0e000 r-xp 00000000 08:07 287007     /usr/local/lib/libbotan-1.10.so.0.1
00e0e000-00e18000 r--p 002ca000 08:07 287007     /usr/local/lib/libbotan-1.10.so.0.1
00e18000-00e1a000 rw-p 002d4000 08:07 287007     /usr/local/lib/libbotan-1.10.so.0.1
00e3f000-00e40000 r-xp 00000000 00:00 0          [vdso]
08048000-0804a000 r-xp 00000000 08:06 155662     /home/sh/qt/test-build-desktop/test
0804a000-0804b000 r--p 00001000 08:06 155662     /home/sh/qt/test-build-desktop/test
0804b000-0804c000 rw-p 00002000 08:06 155662     /home/sh/qt/test-build-desktop/test
09529000-0954a000 rw-p 00000000 00:00 0          [heap]
b77ee000-b77f4000 rw-p 00000000 00:00 0 
b7812000-b7814000 rw-p 00000000 00:00 0 
bfb45000-bfb66000 rw-p 00000000 00:00 0          [stack]
The program has unexpectedly finished.

I have no ideas why I got it(of course, I understand that there is something wrong with stack). But I can’t even dare condemn Botan for this. So I expect that I have done somewhere something wrong. Of course, I can leave this library and to try something different. But I have bound myself to this library already(I used decrypt() and ecnrypt()- wealthy), so I don’t want to create yet once dependency.
I will be really glad and even happy, if somebody gives me tips where my mistake hides.

oops, it’s hard to see my screenshots. I reuploaded them:

http://s14.radikal.ru/i187/1203/d1/b1b1a52d051d.png

http://s51.radikal.ru/i131/1203/5f/893fe9f6bbc5.png

I can only guess that there is something wrong in Botan…. But it’s unbelievable

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:10:22+00:00Added an answer on May 31, 2026 at 1:10 am

    Well. I wrote a letter to creator of Botan – Jack Lloyd and he answered!!!uraaa. His personal web page is http://www.randombit.net/ .
    He suggested that source of error may be usage of headers that are related to different versions of library. i.e. I had a few version of headers, but one library. I mixed them together.
    Worked code:

    #include <botan-1.10/botan/botan.h>
    #include <botan-1.10/botan/bcrypt.h>
    #include <iostream>
    using namespace std;
    using namespace Botan;
    
     int main(int argc, char* argv[])
      {
        LibraryInitializer init;
        AutoSeeded_RNG rng;
        int a=1;
        string strr="4sdfgnglkjnfkdfdfndfglgndlkgdnlkjj";
        cout<<generate_bcrypt(strr, rng,a);
        return 0;
       }
    

    Also I linked explicitly library:

    LIBS += -lbotan \
    /home/sh/qt/usb_encrypt/libraries/libbotan-1.10.a

    Thank you, Jack Lloyd, for such wonderful library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the last 50 tweets using a certain hash tag, on
I am trying to get a hash value for a string using MessageDigest in
Trying to get a value out of 2d array inside of a hash and
I'm trying get values from a GridView using the following code: foreach (GridViewRow row
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get
Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request,
I'm trying to use the Net::Twitter::Stream Perl module from CPAN to read the stream
I'm trying to get the md5 hash of a file in Go, like thus:
I am trying to perform a simple jQuery AJAX attempt using either a .get()
I am trying to get the mercurial revision number/id (it's a hash not a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.