匿名用户2021年12月24日
50阅读
开发技术Python
所属分类Web3、开源货币/比特币
授权协议Readme

作品详情

Brainflayer

BrainflayerisaProof-of-Conceptbrainwalletcrackingtoolthatuseslibsecp256k1forpubkeygeneration.ItwasoriginallyreleasedaspartofmyDEFCONtalkaboutcrackingbrainwallets(slides,video,why).

ThenameisareferencetoMindFlayers,araceofmonstersfromtheDungeons&Dragonsrole-playinggame.Theyeatbrains,psionicallyenslavepeopleandlooklikelovecraftianhorrors.

ThecurrentreleaseismorethanfourtimesfasterthantheDEFCONrelease,andmanyfeatureshavebeenadded.

Ifbrainflayerisusefultoyou,pleasegetintouchtoletmeknow.I'mveryinterestedinanyresearchit'sbeingusedfor,andI'mgenerallyhappytocollaboratewithacademicgroups.

Disclaimer

Justbecauseyoucanstealsomeone'smoneydoesn'tmeanyoushould.Stealingwouldmakeyouajerk.Don'tbeajerk.

Nosupportwillbeprovidedatthistime,andImayignoreorcloseissuesrequestingsupportwithoutresponding.

THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANYEXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALLTHECOPYRIGHTHOLDERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENTOFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,ORTORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHISSOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

UsageBasic

Precomputethebloomfilter:

hex2blfexample.hexexample.blf

RunBrainflayeragainstit:

brainflayer-v-bexample.blf-iphraselist.txt

or

your_generator|brainflayer-v-bexample.blf

Advanced

Brainflayer'sdesignisheavilyinfluencedbyUnixphilosophy.It(mostly)doesonething:huntfortastybrainwallets.Amajorfeatureitdoesnothaveisgeneratingcandidatepasswords/passphrases.Thereareplentyofothergreattoolsthatdothat,andbrainflayerishappytohaveyoupipetheiroutputtoit.

Unfortunately,brainflayerisnotcurrentlymultithreaded.Ifyouwanttohaveitkeepmultiplecoresbusy,you'llhavetocomeupwithawaytodistributetheworkyourself(brainflayer's-nand-koptionsmayhelp).Inmytesting,brainflayerbenefitssignificantlyfromhyperthreading,soyoumaywanttoruntwocopiesperphysicalcore.Alsoworthnotingisthatbrainflayermmapsitsdatafilesinsharedmemory,soadditionalbrainflayerprocessesdonotuseupthatmuchadditionalRAM.

Whilenotstrictlyrequired,itishighlyrecommendedtousethefollowingoptions:

-mFILELoadtheecmulttablefromFILE(generatedwithecmtabgen)ratherthancomputingitonstartup.Thiswillallowmultiplebrainflayerprocessestosharethesametableinmemory,andsignifigantlyreducestartuptimewhenusingalargetable.

-fFILEVerifycheckbloomfiltermatchesagainstFILE,alistofallhash160sgeneratedwithsort-uexample.hex|xxd-r-p>example.binEnoughaddressesexistontheBitcoinnetworktocausefalsepositivesinthebloomfilter,thisoptionwillsuppressthem.

Brainflayersupportsafewothertypesofinputviathe-toption:

-tkeccakpassphrasestobehashedwithkeccak256(someethereumtools)

-tprivrawprivatekeys-thiscanbeusedtosupportarbitrarydeterministicwalletschemesviaanexternalprogram.Anytrailingdataafterthehexencodedprivatekeywillbeincludedinbrainflayer'soutputaswell,forreference.Seealsothe-Ioptionifyouwanttocrackabunchofsequentialkeys,whichhasspecialspeedoptimizations.

-twarpsaltsorpasswords/passphrasesforWarpWallet

-tbwiosaltsorpasswords/passphrasesforbrainwallet.io

-tbv2saltsorpasswords/passphrasesforbrainv2-thisoneisveryslowonCPU,howevertheparameterchoicesmakeitagreattargetforGPUsandFPGAs.

-trushpasswordsforpassword-protectedrushwallets-passthefragment(thepartoftheurlafterthe#)using-r.Almostallwrongpasswordswillberejectedevenwithoutabloomfilter.

Addresstypescanbespecifiedwiththe-coption:

-cuuncompressedaddresses

-cccompressedaddresses

-ceethereumaddresses

-cxmostsignifigantbitsofpublicpoint'sxcoordinate

It'spossibletocombinetwoormoreofthese,e.g.thedefaultis-cuc.

Anincrementalprivatekeybruteforcemodeisavailableforfansofdirectory.io,try

brainflayer-v-I0000000000000000000000000000000000000000000000000000000000000001-bexample.blf

Seetheoutputofbrainflayer-hformoredetailedusageinfo.

Alsoincludedisblfchk-youcanpipeithexencodedhash160tocheckabloomfilterfilefor.It'sveryfast-itcaneasilycheckmillionsofhash160spersecond.NotentirelysurewhatthisisgoodforbutI'msureyou'llcomeupwithsomething.

Building

ShouldcompileonLinuxwithmakeprovidedyouhavetherequireddevellibsinstalled(atleastopensslandgmparerequiredalongwithlibsecp256k1'sbuilddependencies).Ireallyneedtolearnautotools.Ifyoufileanissueaboutabuildfailureinlibsecp256k1Iwillcloseit.

Dependenciesshouldinstallwith

aptinstallbuild-essentiallibgmp-devlibssl-dev

SupportedbuildtargetiscurrentlyUbuntu20.04onamd64/x86_64.Issueswithbuildingforotherplatformsprobablywon’tbefixed.Inparticular,KaliLinuxisnotsupported.SupportforoperatingsystemsotherthanLinuxwouldrequireextensiverefactoringofBrainflayer'smemoryoptimizationsandisnothappening.

Redistributionofcompiledbrainflayerbinariesisprohibited,andunauthorizedbinariesprobablycontainmalware.

Authors

ThebulkofBrainflayerwaswrittenbyRyanCastellucci.NicolasCourtoisandGuangyanSongcontributedthecodeinec_pubkey_fast.cwhichmorethandoublesthespeedofpublickeycomputationscomparedwiththestocksecp256k1libraryfromBitcoin.Thiscodeusesamuchlargertableforecmultiplicationandoptimizedroutinesforecadditionanddoubling.

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论