├── .classpath ├── .project ├── .settings └── org.eclipse.jdt.core.prefs ├── FileKeywords.dat ├── KeywordFiles.dat ├── README.md ├── bin ├── bloomfilter │ └── BloomFilter.class ├── bxt │ ├── BXTProtocol.class │ └── entity │ │ ├── BXTClientToServer.class │ │ └── BXTEDB.class ├── hve │ └── HVEIP08.class ├── hxt │ ├── HXTProtocol.class │ └── entity │ │ └── HXTEDB.class ├── oxt │ ├── OXTProtocol.class │ └── entity │ │ ├── OXTClientToServer.class │ │ ├── OXTEDB.class │ │ ├── OXTTSetBlock.class │ │ └── OXTTSetTuple.class ├── sks │ ├── SKSProtocol.class │ └── entity │ │ ├── FileKeywords.class │ │ ├── FileKeywordsGen.class │ │ ├── KeywordFiles.class │ │ ├── KeywordFilesGen.class │ │ ├── SKSEDB.class │ │ └── TSetBlock.class └── util │ ├── AES.class │ ├── Hash.class │ └── IntAndByte.class ├── lib ├── bcpkix-jdk15on-154.jar ├── bcprov-jdk16-1.46.jar ├── hamcrest-core-1.3.jar ├── jna-3.2.5.jar ├── jpbc-api-2.0.0.jar ├── jpbc-benchmark-2.0.0.jar ├── jpbc-crypto-2.0.0.jar ├── jpbc-mm-2.0.0.jar ├── jpbc-pbc-2.0.0.jar ├── jpbc-plaf-2.0.0.jar ├── junit-4.12.jar └── test │ └── jpbc-test-2.0.0-tests.jar ├── params ├── curves │ ├── a.properties │ ├── a1.properties │ ├── d159.properties │ ├── d201.properties │ ├── d224.properties │ ├── e.properties │ ├── f.properties │ └── g149.properties └── mm │ └── ctl13 │ ├── extra.properties │ ├── large.properties │ ├── medium.properties │ ├── small.properties │ └── toy.properties └── src ├── bloomfilter └── BloomFilter.java ├── bxt ├── BXTProtocol.java └── entity │ ├── BXTClientToServer.java │ └── BXTEDB.java ├── hve └── HVEIP08.java ├── hxt ├── HXTProtocol.java └── entity │ └── HXTEDB.java ├── oxt ├── OXTProtocol.java └── entity │ ├── OXTClientToServer.java │ ├── OXTEDB.java │ ├── OXTTSetBlock.java │ └── OXTTSetTuple.java ├── sks ├── SKSProtocol.java └── entity │ ├── FileKeywords.java │ ├── FileKeywordsGen.java │ ├── KeywordFiles.java │ ├── KeywordFilesGen.java │ ├── SKSEDB.java │ └── TSetBlock.java └── util ├── AES.java ├── Hash.java └── IntAndByte.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | SSE 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Jul 25 08:43:24 CST 2016 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.6 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.6 13 | -------------------------------------------------------------------------------- /FileKeywords.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/FileKeywords.dat -------------------------------------------------------------------------------- /KeywordFiles.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/KeywordFiles.dat -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Boolean Query SSE Schemes 2 | This repository includes a set of prototypes for boolean query SSE schemes. 3 | 4 | In particular, we implement three SSE schemes proposed in [1]: Single Keyword Search (SKS), Basic Cross-Tags Protocol (BXT), and Oblivious Cross-Tags Protocol (OXT). Moreover, we implement a variant of OXT based on public-key based hidden vector encryption, named Hidden Cross-Tags Protocol (HXT). 5 | 6 | # Usage 7 | 8 | Import this project to eclipse/myeclipse; include jpbc-api-2.0.0.jar and jpbc-plaf-2.0.0.jar stored in the lib folder (JPBC library). Then you are ready to run all the schemes in the src folder. 9 | 10 | * SKS: src/sks/SKSProtocol.java 11 | * BXT: src/bxt/BXTProtocol.java 12 | * OXT: src/oxt/OXTProtocol.java 13 | * HXT: src/hxt/HXTProtocol.java 14 | 15 | # Contact Us 16 | 17 | If you have any question, please feel free to contact us. 18 | 19 | * Cong Zuo: cong.zuo1@monash.edu 20 | * Shangqi Lai: shangqi.lai@monash.edu 21 | 22 | # References 23 | 24 | [1] Cash, David, Stanislaw Jarecki, Charanjit Jutla, Hugo Krawczyk, Marcel-Cătălin Roşu, and Michael Steiner. "Highly-scalable searchable symmetric encryption with support for boolean queries." In CRYPTO, pp. 353-373. Springer, Berlin, Heidelberg, 2013. 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /bin/bloomfilter/BloomFilter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/bloomfilter/BloomFilter.class -------------------------------------------------------------------------------- /bin/bxt/BXTProtocol.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/bxt/BXTProtocol.class -------------------------------------------------------------------------------- /bin/bxt/entity/BXTClientToServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/bxt/entity/BXTClientToServer.class -------------------------------------------------------------------------------- /bin/bxt/entity/BXTEDB.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/bxt/entity/BXTEDB.class -------------------------------------------------------------------------------- /bin/hve/HVEIP08.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/hve/HVEIP08.class -------------------------------------------------------------------------------- /bin/hxt/HXTProtocol.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/hxt/HXTProtocol.class -------------------------------------------------------------------------------- /bin/hxt/entity/HXTEDB.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/hxt/entity/HXTEDB.class -------------------------------------------------------------------------------- /bin/oxt/OXTProtocol.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/oxt/OXTProtocol.class -------------------------------------------------------------------------------- /bin/oxt/entity/OXTClientToServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/oxt/entity/OXTClientToServer.class -------------------------------------------------------------------------------- /bin/oxt/entity/OXTEDB.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/oxt/entity/OXTEDB.class -------------------------------------------------------------------------------- /bin/oxt/entity/OXTTSetBlock.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/oxt/entity/OXTTSetBlock.class -------------------------------------------------------------------------------- /bin/oxt/entity/OXTTSetTuple.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/oxt/entity/OXTTSetTuple.class -------------------------------------------------------------------------------- /bin/sks/SKSProtocol.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/sks/SKSProtocol.class -------------------------------------------------------------------------------- /bin/sks/entity/FileKeywords.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/sks/entity/FileKeywords.class -------------------------------------------------------------------------------- /bin/sks/entity/FileKeywordsGen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/sks/entity/FileKeywordsGen.class -------------------------------------------------------------------------------- /bin/sks/entity/KeywordFiles.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/sks/entity/KeywordFiles.class -------------------------------------------------------------------------------- /bin/sks/entity/KeywordFilesGen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/sks/entity/KeywordFilesGen.class -------------------------------------------------------------------------------- /bin/sks/entity/SKSEDB.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/sks/entity/SKSEDB.class -------------------------------------------------------------------------------- /bin/sks/entity/TSetBlock.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/sks/entity/TSetBlock.class -------------------------------------------------------------------------------- /bin/util/AES.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/util/AES.class -------------------------------------------------------------------------------- /bin/util/Hash.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/util/Hash.class -------------------------------------------------------------------------------- /bin/util/IntAndByte.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/bin/util/IntAndByte.class -------------------------------------------------------------------------------- /lib/bcpkix-jdk15on-154.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/bcpkix-jdk15on-154.jar -------------------------------------------------------------------------------- /lib/bcprov-jdk16-1.46.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/bcprov-jdk16-1.46.jar -------------------------------------------------------------------------------- /lib/hamcrest-core-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/hamcrest-core-1.3.jar -------------------------------------------------------------------------------- /lib/jna-3.2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/jna-3.2.5.jar -------------------------------------------------------------------------------- /lib/jpbc-api-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/jpbc-api-2.0.0.jar -------------------------------------------------------------------------------- /lib/jpbc-benchmark-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/jpbc-benchmark-2.0.0.jar -------------------------------------------------------------------------------- /lib/jpbc-crypto-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/jpbc-crypto-2.0.0.jar -------------------------------------------------------------------------------- /lib/jpbc-mm-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/jpbc-mm-2.0.0.jar -------------------------------------------------------------------------------- /lib/jpbc-pbc-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/jpbc-pbc-2.0.0.jar -------------------------------------------------------------------------------- /lib/jpbc-plaf-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/jpbc-plaf-2.0.0.jar -------------------------------------------------------------------------------- /lib/junit-4.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/junit-4.12.jar -------------------------------------------------------------------------------- /lib/test/jpbc-test-2.0.0-tests.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/lib/test/jpbc-test-2.0.0-tests.jar -------------------------------------------------------------------------------- /params/curves/a.properties: -------------------------------------------------------------------------------- 1 | type a 2 | q 8780710799663312522437781984754049815806883199414208211028653399266475630880222957078625179422662221423155858769582317459277713367317481324925129998224791 3 | h 12016012264891146079388821366740534204802954401251311822919615131047207289359704531102844802183906537786776 4 | r 730750818665451621361119245571504901405976559617 5 | exp2 159 6 | exp1 107 7 | sign1 1 8 | sign0 1 9 | -------------------------------------------------------------------------------- /params/curves/a1.properties: -------------------------------------------------------------------------------- 1 | type a1 2 | p 48512875896303752499712277254589628516419352188294521198189567511009073158115045361294839347099315898960045398524682007334164928531594799149100548036445760110913157420655690361891290858441360807158247259460501343449199712532828063940008683740048500980441989713739689655610578458388126934242630557397618776539259 3 | n 36203638728584889925158415861634051131656232976339194924022065306723188923966451762160327870969638730567198058600508960697138006366861790409776528385407283664860565239295291314844246909284597617282274074224254733917313218308080644731349763985110821627195514711746037056425804819692632040479575042834043863089 4 | l 1340 5 | -------------------------------------------------------------------------------- /params/curves/d159.properties: -------------------------------------------------------------------------------- 1 | type d 2 | q 625852803282871856053922297323874661378036491717 3 | n 625852803282871856053923088432465995634661283063 4 | h 3 5 | r 208617601094290618684641029477488665211553761021 6 | a 581595782028432961150765424293919699975513269268 7 | b 517921465817243828776542439081147840953753552322 8 | k 6 9 | nk 60094290356408407130984161127310078516360031868417968262992864809623507269833854678414046779817844853757026858774966331434198257512457993293271849043664655146443229029069463392046837830267994222789160047337432075266619082657640364986415435746294498140589844832666082434658532589211525696 10 | hk 1380801711862212484403205699005242141541629761433899149236405232528956996854655261075303661691995273080620762287276051361446528504633283152278831183711301329765591450680250000592437612973269056 11 | coeff0 472731500571015189154958232321864199355792223347 12 | coeff1 352243926696145937581894994871017455453604730246 13 | coeff2 289113341693870057212775990719504267185772707305 14 | nqr 431211441436589568382088865288592347194866189652 15 | -------------------------------------------------------------------------------- /params/curves/d201.properties: -------------------------------------------------------------------------------- 1 | type d 2 | q 2094476214847295281570670320144695883131009753607350517892357 3 | n 2094476214847295281570670320143248652598286201895740019876423 4 | h 1122591 5 | r 1865751832009427548920907365321162072917283500309320153 6 | a 9937051644888803031325524114144300859517912378923477935510 7 | b 6624701096592535354217016076096200573011941585948985290340 8 | k 6 9 | nk 84421409121513221644716967251498543569964760150943970280296295496165154657097987617093928595467244393873913569302597521196137376192587250931727762632568620562823714441576400096248911214941742242106512149305076320555351603145285797909942596124862593877499051211952936404822228308154770272833273836975042632765377879565229109013234552083886934379264203243445590336 10 | hk 24251848326363771171270027814768648115136299306034875585195931346818912374815385257266068811350396365799298585287746735681314613260560203359251331805443378322987677594618057568388400134442772232086258797844238238645130212769322779762522643806720212266304 11 | coeff0 362345194706722765382504711221797122584657971082977778415831 12 | coeff1 856577648996637037517940613304411075703495574379408261091623 13 | coeff2 372728063705230489408480761157081724912117414311754674153886 14 | nqr 279252656555925299126768437760706333663688384547737180929542 15 | -------------------------------------------------------------------------------- /params/curves/d224.properties: -------------------------------------------------------------------------------- 1 | type d 2 | q 15028799613985034465755506450771565229282832217860390155996483840017 3 | n 15028799613985034465755506450771561352583254744125520639296541195021 4 | h 1 5 | r 15028799613985034465755506450771561352583254744125520639296541195021 6 | a 1871224163624666631860092489128939059944978347142292177323825642096 7 | b 9795501723343380547144152006776653149306466138012730640114125605701 8 | k 6 9 | nk 11522474695025217370062603013790980334538096429455689114222024912184432319228393204650383661781864806076247259556378350541669994344878430136202714945761488385890619925553457668158504202786580559970945936657636855346713598888067516214634859330554634505767198415857150479345944721710356274047707536156296215573412763735135600953865419000398920292535215757291539307525639675204597938919504807427238735811520 10 | hk 51014915936684265604900487195256160848193571244274648855332475661658304506316301006112887177277345010864012988127829655449256424871024500368597989462373813062189274150916552689262852603254011248502356041206544262755481779137398040376281542938513970473990787064615734720 11 | coeff0 11975189258259697166257037825227536931446707944682470951111859446192 12 | coeff1 13433042200347934827742738095249546804006687562088254057411901362771 13 | coeff2 8327464521117791238079105175448122006759863625508043495770887411614 14 | nqr 142721363302176037340346936780070353538541593770301992936740616924 15 | -------------------------------------------------------------------------------- /params/curves/e.properties: -------------------------------------------------------------------------------- 1 | type e 2 | q 7245986106510086080714203333362098431608853335867425877960916928496629182991629664903654100214900946450053872786629995869445693724001299041657434948257845644905153122838458864000479326695430719258600053239930483226650953770354174712511646273516974069245462534034085895319225452125649979474047163305307830001 3 | r 730750862221594424981965739670091261094297337857 4 | h 13569343110918781839835249021482970252603216587988030044836106948825516930173270978617489032334001006615524543925753725725046733884363846960470444404747241287743773746682188521738728797153760275116924829183670000 5 | a 7130970454025799000067946137594446075551569949583815943390108723282396973737794273397246892274981883807989525599540630855644968426794929215599380425269625872763801485968007136000471718335185787206876242871042697778608875139078711621836858237429403052273312335081163896980825048123655535355411494046493419999 6 | b 7169309004853894693616698536183663527570664411678352588247044791687141043489072737232715961588288238022010974661903752526911876859197052490952065266265699130144252031591491045333807587788600764557450846327338626261289568016170532652061787582791926724597362401398804563093625182790987016728290050466098223333 7 | exp2 159 8 | exp1 135 9 | sign1 1 10 | sign0 1 11 | -------------------------------------------------------------------------------- /params/curves/f.properties: -------------------------------------------------------------------------------- 1 | type f 2 | q 205523667896953300194896352429254920972540065223 3 | r 205523667896953300194895899082072403858390252929 4 | b 40218105156867728698573668525883168222119515413 5 | beta 115334401956802802075595682801335644058796914268 6 | alpha0 191079354656274778837764015557338301375963168470 7 | alpha1 71445317903696340296199556072836940741717506375 8 | -------------------------------------------------------------------------------- /params/curves/g149.properties: -------------------------------------------------------------------------------- 1 | type g 2 | q 503189899097385532598615948567975432740967203 3 | n 503189899097385532598571084778608176410973351 4 | h 1 5 | r 503189899097385532598571084778608176410973351 6 | a 465197998498440909244782433627180757481058321 7 | b 463074517126110479409374670871346701448503064 8 | k 10 9 | nk 1040684643531490707494989587381629956832530311976146077888095795458709511789670022388326295177424065807612879371896982185473788988016190582073591316127396374860265835641044035656044524481121528846249501655527462202999638159773731830375673076317719519977183373353791119388388468745670818193868532404392452816602538968163226713846951514831917487400267590451867746120591750902040267826351982737642689423713163967384383105678367875981348397359466338807 10 | hk 4110127713690841149713310614420858884651261781185442551927080083178682965171097172366598236129731931693425629387502221804555636704708008882811353539555915064049685663790355716130262332064327767695339422323460458479884756000782939428852120522712008037615051139080628734566850259704397643028017435446110322024094259858170303605703280329322675124728639532674407 11 | coeff0 67343110967802947677845897216565803152319250 12 | coeff1 115936772834120270862756636148166314916823221 13 | coeff2 87387877425076080433559927080662339215696505 14 | coeff3 433223145899090928132052677121692683015058909 15 | coeff4 405367866213598664862417230702935310328613596 16 | nqr 22204504160560785687198080413579021865783099 17 | -------------------------------------------------------------------------------- /params/mm/ctl13/extra.properties: -------------------------------------------------------------------------------- 1 | type ctl13 2 | eta 2351 3 | n 26265 4 | alpha 80 5 | ell 160 6 | rho 85 7 | delta 162 8 | kappa 6 9 | beta 80 10 | theta 16 11 | bound 160 12 | -------------------------------------------------------------------------------- /params/mm/ctl13/large.properties: -------------------------------------------------------------------------------- 1 | type ctl13 2 | eta 2182 3 | n 8355 4 | alpha 80 5 | ell 160 6 | rho 72 7 | delta 91 8 | kappa 6 9 | beta 80 10 | theta 16 11 | bound 160 12 | -------------------------------------------------------------------------------- /params/mm/ctl13/medium.properties: -------------------------------------------------------------------------------- 1 | type ctl13 2 | eta 1974 3 | n 2100 4 | alpha 80 5 | ell 160 6 | rho 56 7 | delta 45 8 | kappa 6 9 | beta 80 10 | theta 16 11 | bound 160 12 | -------------------------------------------------------------------------------- /params/mm/ctl13/small.properties: -------------------------------------------------------------------------------- 1 | type ctl13 2 | eta 1779 3 | n 540 4 | alpha 80 5 | ell 160 6 | rho 41 7 | delta 23 8 | kappa 6 9 | beta 80 10 | theta 16 11 | bound 160 12 | -------------------------------------------------------------------------------- /params/mm/ctl13/toy.properties: -------------------------------------------------------------------------------- 1 | type ctl13 2 | eta 757 3 | n 165 4 | alpha 10 5 | ell 160 6 | rho 27 7 | delta 12 8 | kappa 5 9 | beta 80 10 | theta 16 11 | bound 160 12 | -------------------------------------------------------------------------------- /src/bloomfilter/BloomFilter.java: -------------------------------------------------------------------------------- 1 | package bloomfilter; 2 | 3 | import hve.HVEIP08; 4 | 5 | import org.bouncycastle.crypto.AsymmetricCipherKeyPair; 6 | import org.bouncycastle.crypto.CipherParameters; 7 | 8 | import util.AES; 9 | 10 | public class BloomFilter { 11 | 12 | public static byte[] F(int k, byte[] message){ 13 | 14 | byte[] a = new byte[1]; 15 | a[0] = (byte)k; 16 | return AES.encrypt(message, a); 17 | } 18 | 19 | public static int[] init_b_0(int m){ 20 | int b[] = new int[m]; 21 | 22 | for(int i=0; i XSet; 15 | 16 | public BXTEDB(int n){ 17 | TSet = new TSetBlock[n]; 18 | for(int i=0; i(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/hve/HVEIP08.java: -------------------------------------------------------------------------------- 1 | package hve; 2 | 3 | import java.security.SecureRandom; 4 | import java.util.Random; 5 | 6 | import it.unisa.dia.gas.crypto.fe.PredicateOnlyEncryptionScheme; 7 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.engines.HVEIP08PredicateOnlyEngine; 8 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.generators.HVEIP08KeyPairGenerator; 9 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.generators.HVEIP08ParametersGenerator; 10 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.generators.HVEIP08PredicateOnlySecretKeyGenerator; 11 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.params.HVEIP08EncryptionParameters; 12 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.params.HVEIP08KeyGenerationParameters; 13 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.params.HVEIP08MasterSecretKeyParameters; 14 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.params.HVEIP08Parameters; 15 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.params.HVEIP08PublicKeyParameters; 16 | import it.unisa.dia.gas.crypto.jpbc.fe.hve.ip08.params.HVEIP08SecretKeyGenerationParameters; 17 | import it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory; 18 | 19 | import org.bouncycastle.crypto.AsymmetricCipherKeyPair; 20 | import org.bouncycastle.crypto.CipherParameters; 21 | import org.bouncycastle.crypto.InvalidCipherTextException; 22 | 23 | import static org.junit.Assert.assertEquals; 24 | 25 | public class HVEIP08 { 26 | 27 | public HVEIP08(){} 28 | 29 | public static AsymmetricCipherKeyPair setup(int n) { 30 | HVEIP08KeyPairGenerator generator = new HVEIP08KeyPairGenerator(); 31 | 32 | generator.init(new HVEIP08KeyGenerationParameters(new SecureRandom(), genBinaryParam(n))); 33 | return generator.generateKeyPair(); 34 | } 35 | 36 | public static CipherParameters keyGen(CipherParameters privateKey, int... pattern) { 37 | HVEIP08PredicateOnlySecretKeyGenerator generator = new HVEIP08PredicateOnlySecretKeyGenerator(); 38 | generator.init(new HVEIP08SecretKeyGenerationParameters( 39 | (HVEIP08MasterSecretKeyParameters) privateKey, pattern)); 40 | 41 | return generator.generateKey(); 42 | } 43 | 44 | public static byte[] enc(CipherParameters publicKey, int... attributes) { 45 | try { 46 | PredicateOnlyEncryptionScheme engine = new HVEIP08PredicateOnlyEngine(); 47 | engine.init(true, new HVEIP08EncryptionParameters((HVEIP08PublicKeyParameters) publicKey, attributes)); 48 | return engine.process(); 49 | } catch (InvalidCipherTextException e) { 50 | throw new RuntimeException(e); 51 | } 52 | } 53 | 54 | public static boolean evaluate(CipherParameters searchKey, byte[] ct) { 55 | try { 56 | PredicateOnlyEncryptionScheme engine = new HVEIP08PredicateOnlyEngine(); 57 | engine.init(false, searchKey); 58 | 59 | return engine.evaluate(ct); 60 | } catch (InvalidCipherTextException e) { 61 | throw new RuntimeException(e); 62 | } 63 | } 64 | 65 | public static HVEIP08Parameters genBinaryParam(int n) { 66 | HVEIP08ParametersGenerator generator = new HVEIP08ParametersGenerator(); 67 | generator.init(n, PairingFactory.getPairingParameters("params/curves/a.properties")); 68 | 69 | return generator.generateParameters(); 70 | } 71 | 72 | public static int[][] createMatchingVectors(int n) { 73 | int[][] result = new int[2][n]; 74 | Random random = new Random(); 75 | 76 | for (int i = 0; i < n; i++) { 77 | if (i != 0 && i != 1 && random.nextBoolean()) {// it's a star 78 | result[0][i] = -1; 79 | result[1][i] = random.nextInt(2); 80 | } else { 81 | result[0][i] = random.nextInt(2); 82 | result[1][i] = result[0][i]; 83 | } 84 | } 85 | return result; 86 | } 87 | 88 | public static int[][] createNonMatchingVectors(int n) { 89 | int[][] result = new int[2][n]; 90 | Random random = new Random(); 91 | for (int i = 0; i < n; i++) { 92 | if (i != 0 && i != 1 && random.nextBoolean()) {// it's a star 93 | result[0][i] = -1; 94 | result[1][i] = random.nextInt(2); 95 | } else { 96 | result[0][i] = random.nextInt(2); 97 | result[1][i] = 1 - result[0][i]; 98 | } 99 | } 100 | return result; 101 | } 102 | 103 | public static void main(String[] args) { 104 | //HVEIP08 hveip08 = new HVEIP08(); 105 | 106 | int n = 5; 107 | AsymmetricCipherKeyPair keyPair = setup(n); 108 | 109 | //int[][] vectors = createMatchingVectors(n); 110 | 111 | int[][] vectors = {{1,1,-1,0,1},{1,1,0,0,1}}; 112 | 113 | //assertEquals(true, evaluate( 114 | // keyGen(keyPair.getPrivate(), vectors[0]), 115 | // enc(keyPair.getPublic(), vectors[1]))); 116 | 117 | System.out.println(evaluate( 118 | keyGen(keyPair.getPrivate(), vectors[0]), 119 | enc(keyPair.getPublic(), vectors[1]))); 120 | 121 | vectors = createNonMatchingVectors(n); 122 | 123 | assertEquals(false, evaluate( 124 | keyGen(keyPair.getPrivate(), vectors[0]), 125 | enc(keyPair.getPublic(), vectors[1]))); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/hxt/HXTProtocol.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/src/hxt/HXTProtocol.java -------------------------------------------------------------------------------- /src/hxt/entity/HXTEDB.java: -------------------------------------------------------------------------------- 1 | package hxt.entity; 2 | 3 | import oxt.entity.OXTTSetBlock; 4 | 5 | public class HXTEDB { 6 | 7 | public byte[] K_S; 8 | public byte[] K_X; 9 | public byte[] K_I; 10 | public byte[] K_Z; 11 | public byte[] K_T; 12 | public byte K_P; 13 | public OXTTSetBlock[] TSet; 14 | public byte[] c; 15 | 16 | public HXTEDB(int n){ 17 | TSet = new OXTTSetBlock[n]; 18 | for(int i=0; i XSet; 15 | 16 | public OXTEDB(int n){ 17 | TSet = new OXTTSetBlock[n]; 18 | for(int i=0; i(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/oxt/entity/OXTTSetBlock.java: -------------------------------------------------------------------------------- 1 | package oxt.entity; 2 | 3 | public class OXTTSetBlock { 4 | public byte[] keyword_enc; 5 | public OXTTSetTuple[] t; 6 | } 7 | -------------------------------------------------------------------------------- /src/oxt/entity/OXTTSetTuple.java: -------------------------------------------------------------------------------- 1 | package oxt.entity; 2 | 3 | import it.unisa.dia.gas.jpbc.Element; 4 | 5 | public class OXTTSetTuple { 6 | public byte[] e; 7 | public Element y; 8 | } 9 | -------------------------------------------------------------------------------- /src/sks/SKSProtocol.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MonashCybersecurityLab/Boolean-Query-SSE/3bb2599cc35287715c2d621903ec38001a365d41/src/sks/SKSProtocol.java -------------------------------------------------------------------------------- /src/sks/entity/FileKeywords.java: -------------------------------------------------------------------------------- 1 | package sks.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | public class FileKeywords implements Serializable{ 6 | private static final long serialVersionUID = 1L; 7 | 8 | public int index; 9 | public String[] keywords; 10 | } 11 | -------------------------------------------------------------------------------- /src/sks/entity/FileKeywordsGen.java: -------------------------------------------------------------------------------- 1 | package sks.entity; 2 | 3 | import java.io.FileNotFoundException; 4 | import java.io.FileOutputStream; 5 | import java.io.IOException; 6 | import java.io.ObjectOutputStream; 7 | 8 | public class FileKeywordsGen { 9 | 10 | public FileKeywords Gen(int index, String[] keywords){ 11 | FileKeywords fk = new FileKeywords(); 12 | fk.index = index; 13 | fk.keywords = keywords; 14 | 15 | return fk; 16 | } 17 | 18 | public static void main(String args[]){ 19 | FileKeywordsGen fkg = new FileKeywordsGen(); 20 | 21 | FileKeywords[] fks = new FileKeywords[7]; 22 | 23 | String[] str1= {"1", "2", "6", "7", "8", "9"}; 24 | String[] str2 = {"2", "3", "4", "5"}; 25 | String[] str3 = {"4", "5", "6", "7"}; 26 | String[] str4 = {"1", "2", "3", "4", "5", "6"}; 27 | String[] str5 = {"1", "3", "6", "9"}; 28 | String[] str6 = {"2", "3", "7", "9", "10"}; 29 | String[] str7 = {"1", "4", "7", "8", "9", "10"}; 30 | 31 | fks[0] = fkg.Gen(1, str1); 32 | fks[1] = fkg.Gen(2, str2); 33 | fks[2] = fkg.Gen(3, str3); 34 | fks[3] = fkg.Gen(4, str4); 35 | fks[4] = fkg.Gen(5, str5); 36 | fks[5] = fkg.Gen(6, str6); 37 | fks[6] = fkg.Gen(7, str7); 38 | 39 | try { 40 | ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("FileKeywords.dat")); 41 | out.writeObject(fks); 42 | out.close(); 43 | } catch (FileNotFoundException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } catch (IOException e) { 47 | // TODO Auto-generated catch block 48 | e.printStackTrace(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/sks/entity/KeywordFiles.java: -------------------------------------------------------------------------------- 1 | package sks.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | public class KeywordFiles implements Serializable{ 6 | private static final long serialVersionUID = 1L; 7 | 8 | public String keyword; 9 | public int[] files; 10 | } 11 | -------------------------------------------------------------------------------- /src/sks/entity/KeywordFilesGen.java: -------------------------------------------------------------------------------- 1 | package sks.entity; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.FileNotFoundException; 5 | import java.io.FileOutputStream; 6 | import java.io.IOException; 7 | import java.io.ObjectInputStream; 8 | import java.io.ObjectOutputStream; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | import java.util.Set; 12 | import java.util.Vector; 13 | 14 | public class KeywordFilesGen { 15 | 16 | public KeywordFiles[] Gen(FileKeywords[] fks){ 17 | Map> keywordfile = new HashMap>(); 18 | 19 | for(int i=0; i vc = keywordfile.get(fks[i].keywords[j]); 22 | if( vc == null){ 23 | vc = new Vector(); 24 | vc.add(fks[i].index); 25 | keywordfile.put(fks[i].keywords[j], vc); 26 | } 27 | else{ 28 | vc.add(fks[i].index); 29 | keywordfile.put(fks[i].keywords[j], vc); 30 | } 31 | } 32 | } 33 | 34 | Set keywordsSet = keywordfile.keySet(); 35 | Object[] keywords = keywordsSet.toArray(); 36 | KeywordFiles[] kfs = new KeywordFiles[keywords.length]; 37 | for(int i=0; i files = keywordfile.get(keywords[i]); 41 | kfs[i].files = new int[files.size()]; 42 | for(int j=0; j