Bitcoin Forum
December 29, 2025, 12:34:54 PM *
News: Latest Bitcoin Core release: 30.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: AES 256 secret key or Bouncy Castle  (Read 257 times)
junior_clk (OP)
Jr. Member
*
Offline Offline

Activity: 30
Merit: 2


View Profile
July 26, 2025, 01:02:36 AM
 #1

Does anyone have a compiled version of Bouncy Castle to use offline?
Or know how I can decrypt a 34 character string with a aes secret key of 16 characters?
ABCbits
Legendary
*
Offline Offline

Activity: 3472
Merit: 9526



View Profile
July 26, 2025, 08:33:07 AM
 #2

Does anyone have a compiled version of Bouncy Castle to use offline?

I can't give good answer, but i assume you're trying to recover Bitcoin from encrypted file/key. So i would recommend you to tell us what wallet software used to generate it, since there may be dedicated software to perform recovery/brute-force (such as BTCRecover that support many wallet format/software).

Or know how I can decrypt a 34 character string with a aes secret key of 16 characters?

34 characters? It may be mini private key, although usually it have either 22 or 30 characters instead. Although Bitcoin legacy/P2PKH address usually have 34 characters.

junior_clk (OP)
Jr. Member
*
Offline Offline

Activity: 30
Merit: 2


View Profile
July 26, 2025, 03:13:54 PM
 #3

it was used in the beginning with BitcoinJ
I believe I can use the secret key on that 34 characters to get the wif or the private key
BittcoinJ used the AES encryption and it was safer then bitcoin 0.3.24
Bitcoin 0.4 started with the passphrases but this was before that
pooya87
Legendary
*
Offline Offline

Activity: 4046
Merit: 12111



View Profile
July 26, 2025, 04:22:32 PM
 #4

Why aren't you using BitcoinJ library again? The newer versions should have kept some backward compatibility which means if we assume your encrypted key is not broken, you should be able to enter it into its decryption function (you gotta find that yourself though) with your password and get the key.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
ABCbits
Legendary
*
Offline Offline

Activity: 3472
Merit: 9526



View Profile
July 27, 2025, 08:21:03 AM
 #5

it was used in the beginning with BitcoinJ

I agree with @pooya87. Using BitcoinJ should be easier than using Bouncy Castle directly. I don't know how to run/use BitcoinJ, but you can download older version of BitcoinJ library on https://repo1.maven.org/maven2/org/bitcoinj/bitcoinj-core/.

I believe I can use the secret key on that 34 characters to get the wif or the private key

I forget to ask about it earlier, but do you mind share the 34 characters format? Does it match any of format shown on https://en.bitcoin.it/wiki/List_of_address_prefixes? If no, how about the basic format (such as binary, hex or base64)?

junior_clk (OP)
Jr. Member
*
Offline Offline

Activity: 30
Merit: 2


View Profile
July 27, 2025, 06:00:20 PM
 #6

the string starts with a 3, yes that would be P2SH but that I tried everything and tested everything,
The first P2SH was mined april 1 2012, looking at old pictures from where I lived and so on, I know it was before that time.
And found the jre from then and the documentation all from 2011

The string is Base58 and when I base64 -> Hex the string of 16 characters it starts with ECA1111111111CD999999999
the numers 1 are 10 capital letters and the numbers 9 are 9 capital letters

But I will try to compile BitcoinJ
Just tought that in BC I could test them by entering them in different aes formats like 128 and 256 or whatever Wink
pooya87
Legendary
*
Offline Offline

Activity: 4046
Merit: 12111



View Profile
July 28, 2025, 03:06:23 AM
 #7

But I will try to compile BitcoinJ
Just tought that in BC I could test them by entering them in different aes formats like 128 and 256 or whatever Wink
It usually is not that simple (to use your password directly as the encryption key). Sometimes an encryption key is derived from your password and then used for encryption which means you have to use the same algorithm to derive that key to be able to decrypt. Which is why I suggested you use BicoinJ itself.

Although I am assuming what you have is an encrypted key because 34-char long Base58 string doesn't look like an encrypted 256-bit private key. In comparison a BIP-38 encrypted key is 58 characters long in Base-58 (39 raw bytes when decoded).

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
junior_clk (OP)
Jr. Member
*
Offline Offline

Activity: 30
Merit: 2


View Profile
July 29, 2025, 01:03:55 AM
 #8

if the 34 character is encoded with delfi heilman it would still be 34 characters but completely different
back in 2011 bitcoin until 0.4 didnt have a wallet private key encryption
there was ASN.1 aes UTF-8 but no complex things
bitcoinj used aes but what was also used?
bitcoinj wallet wasnt compatible with bitcoin core wallet but what else?
pooya87
Legendary
*
Offline Offline

Activity: 4046
Merit: 12111



View Profile
August 04, 2025, 03:11:14 AM
Merited by ABCbits (1)
 #9

if the 34 character is encoded with delfi heilman it would still be 34 characters but completely different
AFAIK the "Diffie-Hellman" algorithm is a protocol that two parties use to share a secret not an individual to encrypt their own secret.

34 characters is still too low because we are talking about a 256-bit (32-byte) key and when encoded to human readable form, any encoding (Base-64, 58, 43, 16) will at least produce roughly 44 characters. For example this is a random 32-byte hash with different encodings:
Code:
Base-16 (64 chars): 3324742944c68e6143874d2befb52f07868820b19a353d9fe466e8a853e170d8
Base-43 (47 chars): GXEP48$D.J5OJBK5-P/.*X10TOVGT0.-EOX:BDNRN2EU4S2
Base-58 (44 chars): 4Se2tEYBtUkshhBUQNhCpitDGrWSaqx8ozyCckoKDXH1
Base-64 (44 chars): MyR0KUTGjmFDh00r77UvB4aIILGaNT2f5GboqFPhcNg=

And again you have to check the tool you used (BitcoinJ?) and see what encoding they were using. The 4 above are common (B43 less common), but there can be an encoding with more charset that shrinks the size.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
junior_clk (OP)
Jr. Member
*
Offline Offline

Activity: 30
Merit: 2


View Profile
August 17, 2025, 09:03:23 PM
Last edit: August 17, 2025, 09:37:07 PM by junior_clk
 #10

i've been digging a bit further
and found a hex starting with 0x8
according to https://en.bitcoin.it/wiki/List_of_address_prefixes that would be the private key

but including the 0x8 its 42 characters?
those 16 characters could be the salt in openssl

or without 0x hash160 the 40 characters?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!