--- tags: - sentence-transformers - sentence-similarity - feature-extraction - dense - generated_from_trainer - dataset_size:77328 - loss:ContrastiveLoss base_model: huggingface/CodeBERTa-small-v1 widget: - source_sentence: "\n\n\n\n\nimport java.io.InputStream;\nimport java.util.Properties;\n\ \nimport javax.naming.Context;\nimport javax.naming.InitialContext;\nimport javax.rmi.PortableRemoteObject;\n\ import javax.sql.DataSource;\n\n\n\npublic class DictionaryPropertyHelper {\n\n\ \tprivate static Properties dictProps;\n\n\n\n\tpublic DictionaryPropertyHelper()\ \ {\n\t}\n\n\n\t\n\tpublic static String getProperty(String pKey){\n\t\ttry{\n\ \t\t\tinitProps();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.err.println(\"\ Error init'ing the dictionary Props\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\ \treturn dictProps.getProperty(pKey);\n\t}\n\n\n\tprivate static void initProps()\ \ throws Exception{\n\t\tif(dictProps == null){\n\t\t\tdictProps = new Properties();\n\ \n\t\t\tInputStream fis =\n\t\t\t\tDictionaryPropertyHelper.class.getResourceAsStream(\"\ /dictionary.properties\");\n\t\t\tdictProps.load(fis);\n\t\t}\n\t}\n}\n\n" sentences: - "\n\n\nimport java.io.InputStream;\nimport java.util.Properties;\n\nimport javax.naming.Context;\n\ import javax.naming.InitialContext;\nimport javax.rmi.PortableRemoteObject;\n\ import javax.sql.DataSource;\n\n\n\n\n\n\npublic class MailsendPropertyHelper\ \ {\n\n\tprivate static Properties testProps;\n\n\tpublic MailsendPropertyHelper()\ \ {\n\t}\n\n\n\t\n\n\tpublic static String getProperty(String pKey){\n\t\ttry{\n\ \t\t\tinitProps();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.err.println(\"\ Error init'ing the watchddog Props\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\ return testProps.getProperty(pKey);\n\t}\n\n\n\tprivate static void initProps()\ \ throws Exception{\n\t\tif(testProps == null){\n\t\t\ttestProps = new Properties();\n\ \n\t\t\tInputStream fis =\n\t\t\t\tMailsendPropertyHelper.class.getResourceAsStream(\"\ /mailsend.properties\");\n\t\t\ttestProps.load(fis);\n\t\t}\n\t}\n}\n\n\n\n\n\n" - "\n\n\n\nimport java.net.*;\nimport java.io.*;\nimport java.util.*;\n\npublic\ \ class WatchDog\n{\n\n public WatchDog()\n {\n }\n\n public static void main(String[]\ \ args)\n {\n try\n {\n if( args.length != 2 )\n \ \ {\n System.out.println(\"USAGE: java WatchDog \"\ );\n System.exit(0);\n }\n\n Runtime.getRuntime().exec(\"\ rm LastWatch.html\");\n Runtime.getRuntime().exec(\"rm WatchDog.ini\"\ );\n\n Thread.sleep(1000);\n\n while (true)\n \ \ {\n WatchDog myWatchDog = new WatchDog();\n \ \ myWatchDog.readHTML(args[0], args[1]);\n\n Runtime.getRuntime().exec(\"\ rm Report.txt\");\n Runtime.getRuntime().exec(\"rm diffReport.txt\"\ );\n Runtime.getRuntime().exec(\"rm NewWatch.txt\");\n\n \ \ System.out.println(\" check after 2 ... press Ctrl-Z suspend WatchDog...\"\ );\n\n Thread.sleep(2*60*1000); \n\n\n }\n }\n\ \ catch (Exception e)\n {\n e.printStackTrace();\n }\n\ \ }\n\n void readHTML (String strHTML, String userName)\n {\n\n Properties\ \ myProp = loadLastMD5 ();\n\n try\n {\n\n System.out.println(\"Running\ \ WatchDog \\\"\" + strHTML + \"\\\" ...... Please Wait....\");\n\n URL\ \ url = new URL (strHTML);\n\n String strHost = url.getHost().toLowerCase();\n\ \n Runtime r = Runtime.getRuntime();\n\n\n\n \n\n \n \n\n InputStream\ \ in = url.openStream();\n\n DataInputStream bf = new DataInputStream (in);\n\ \n FileOutputStream fOut = new FileOutputStream (\"Watch.html\");\n \ \ DataOutputStream dOut = new DataOutputStream (fOut);\n\n Vector vtrImages\ \ = new Vector ();\n\n while ( bf!= null)\n {\n\n String str\ \ = bf.readLine();\n\n if (str == null)\n break;\n\n\n \ \ if ( str.toLowerCase().indexOf(\"img\") > 0 )\n {\n \ \ int indexImg = str.toLowerCase().indexOf(\"img\");\n int indexImgUrl\ \ = str.toLowerCase().indexOf(\"\\\"\", indexImg);\n int indexImgUrlEnd\ \ = str.toLowerCase().indexOf(\"\\\"\", indexImgUrl+1);\n\n String\ \ strImage = str.toLowerCase().substring(indexImgUrl+1, indexImgUrlEnd);\n\n \ \ if (strImage.toLowerCase().indexOf(strHost) > 0)\n {\n\ \ int index = strImage.toLowerCase().indexOf(strHost) + strHost.length();\n\ \ strImage = strImage.toLowerCase().substring(index);\n \ \ }\n\n if (!vtrImages.contains(strImage.toLowerCase()))\n \ \ vtrImages.add (strImage.toLowerCase());\n }\n\n \ \ dOut.writeBytes(str+\"\\n\");\n }\n\n dOut.print();\n fOut.print();\n\ \ \n \n\n for (int i=0 ; i < vtrImages.size() ; i ++)\n {\n\n \ \ \n r.exec(\"wget \" + strHost + vtrImages.get(i).toString().trim());\n\ \ }\n\n Thread.sleep(2000);\n\n String [] command = {\"//sh\",\ \ \"-c\",\"md5sum *.* > NewWatch.txt\"};\n\n Runtime.getRuntime().exec(command);\n\ \n Thread.sleep(1000);\n\n FileInputStream fIn = new FileInputStream\ \ (\"NewWatch.txt\");\n DataInputStream = new DataInputStream (fIn);\n\n\ \ Properties prop = new Properties ();\n\n while ( bf != null)\n \ \ {\n\n String str = bf.readLine();\n\n if (str == null)\n\ \ break;\n\n int index = str.indexOf(\" \");\n\n\n \ \ if (fileDownloaded (str.substring(index + 1), vtrImages) || str.substring(index\ \ + 1).trim().equalsIgnoreCase(\"Watch.html\") )\n prop.setProperty(str.substring(index\ \ + 1).trim().toLowerCase(), str.substring(0, index).trim().toLowerCase());\n\ \ }\n\n \n fIn.close();\n\n int isAnyChange = GenerateChangeFile\ \ (strHTML, myProp, prop);\n\n if (isAnyChange > 0)\n {\n\n if\ \ (isAnyChange == 2)\n {\n File f = new File (\"LastWatch.html\"\ );\n\n if (! f.exists())\n {\n f.createNewFile();\n\ \ Thread.sleep(1000);\n }\n\n String [] diffCommand\ \ = {\"//sh\", \"-c\",\"diff Watch.html LastWatch.html > diffReport.txt\"};\n\n\ \ Runtime.getRuntime().exec(diffCommand);\n\n Thread.sleep(2000);\n\ \n FileInputStream feIn = new FileInputStream (\"diffReport.txt\");\n\ \ DataInputStream deIn = new DataInputStream (feIn);\n\n \ \ FileOutputStream feOut = new FileOutputStream (\"Report.txt\", true);\n \ \ DataOutputStream deOut = new DataOutputStream (feOut);\n\n \ \ deOut.writeBytes(\"\\n\\n\\nDifferences in Target :\\n\\n\");\n\n \ \ while (deIn != null)\n {\n String str = deIn.readLine();\n\ \n if (str == null)\n break;\n\n \ \ deOut.writeBytes(str + \"\\n\");\n }\n\n deOut.print();\n\ \ feOut.print();\n\n deIn.close();\n feIn.close();\n\ \ }\n\n String [] mailCommand = {\"//sh\", \"-c\",\"less Report.txt\ \ | mail \" + userName};\n\n Runtime.getRuntime().exec(mailCommand);\n\n\ \ System.out.println(\"Mailing difference\");\n }\n else\n \ \ System.out.println(\" difference detected\");\n\n\n Runtime.getRuntime().exec(\"\ mv Watch.html LastWatch.html\");\n\n }\n catch (Exception e)\n {\n \ \ e.printStackTrace();\n }\n\n }\n\n private Properties loadLastMD5\ \ ()\n {\n Properties myProp = new Properties ();\n\n try\n {\n\ \ myProp.load(new FileInputStream (\"WatchDog.ini\"));\n }\n \ \ catch (Exception e)\n {\n }\n\n return myProp;\n }\n\n private\ \ boolean fileDownloaded (String strFile, Vector vtrImages)\n {\n for (\ \ int i = 0 ; i < vtrImages.size() ; i ++ )\n {\n String strImage\ \ = vtrImages.get(i).toString().trim();\n\n if ( strImage.toLowerCase().indexOf(strFile.toLowerCase().trim())\ \ > -1 )\n return true;\n }\n\n return false;\n }\n\n\ \ private int GenerateChangeFile (String strUrl, Properties myProp, Properties\ \ prop)\n {\n int change = 0;\n boolean boolMainChange = false;\n\n\ \ try\n {\n FileOutputStream myOut = new FileOutputStream (\"\ WatchDog.ini\");\n DataOutputStream myIniOut = new DataOutputStream (myOut);\n\ \n FileOutputStream fOut = new FileOutputStream (\"Report.txt\");\n \ \ DataOutputStream dOut = new DataOutputStream (fOut);\n\n dOut.writeBytes(\"\ Report of changes for \\\"\" + strUrl + \"\\\":\\n\\n\\n\\n\\n\");\n\n \ \ Enumeration e = prop.keys();\n\n while (e.hasMoreElements())\n \ \ {\n String file = e.nextElement().toString().toLowerCase().trim();\n\ \n Runtime.getRuntime().exec(\"rm \" + file);\n\n myIniOut.writeBytes(file.toLowerCase()\ \ + \"=\" + prop.getProperty(file) + \"\\n\");\n\n if (myProp.containsKey(file))\n\ \ {\n String OldValue = myProp.getProperty(file);\n\ \ String newValue = prop.getProperty(file);\n\n \ \ if (OldValue != null && newValue != null)\n {\n \ \ if (!OldValue.trim().equals(newValue.trim()))\n \ \ {\n if (file.toLowerCase().trim().equalsIgnoreCase(\"\ Watch.html\"))\n {\n dOut.writeBytes(\"\ Traget html has been changed\\n\");\n boolMainChange\ \ = true;\n }\n else\n \ \ dOut.writeBytes(\"File \\\"\" + file + \"\\\" has been\ \ changed\\n\");\n\n change = 1;\n \ \ }\n }\n }\n else\n \ \ {\n if (file.toLowerCase().trim().equalsIgnoreCase(\"Watch.html\"\ ))\n {\n dOut.writeBytes(\"Target html\ \ is checked for first time\\n\");\n boolMainChange = true;\n\ \ }\n else\n dOut.writeBytes(\"\ File \\\"\" + file + \"\\\" is checked for first time and is new\\n\");\n\n \ \ change = 1;\n }\n }\n\n dOut.print();\n\ \ fOut.print();\n\n myIniOut.close();\n myOut.close();\n\ \ }\n catch (Exception ex)\n {\n ex.printStackTrace ();\n\ \ }\n\n if (boolMainChange)\n return 2;\n\n return change;\n\ \ }\n}" - "\n\n\nimport java.io.InputStream;\nimport java.util.Properties;\n\nimport javax.naming.Context;\n\ import javax.naming.InitialContext;\nimport javax.rmi.PortableRemoteObject;\n\ import javax.sql.DataSource;\n\n\n\n\n\n\npublic class MailsendPropertyHelper\ \ {\n\n\tprivate static Properties testProps;\n\n\tpublic MailsendPropertyHelper()\ \ {\n\t}\n\n\n\t\n\n\tpublic static String getProperty(String pKey){\n\t\ttry{\n\ \t\t\tinitProps();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.err.println(\"\ Error init'ing the watchddog Props\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\ return testProps.getProperty(pKey);\n\t}\n\n\n\tprivate static void initProps()\ \ throws Exception{\n\t\tif(testProps == null){\n\t\t\ttestProps = new Properties();\n\ \n\t\t\tInputStream fis =\n\t\t\t\tMailsendPropertyHelper.class.getResourceAsStream(\"\ /mailsend.properties\");\n\t\t\ttestProps.load(fis);\n\t\t}\n\t}\n}\n\n\n\n\n\n" - source_sentence: "\n\nimport java.io.*;\nimport java.*;\nimport java.util.StringTokenizer;\n\ \npublic class Dictionary\n{\n public static void main(String args[])\n {\n\ \ final String DICT_FILE = \"/usr/share/lib/dict/words\"; \n String\ \ basic_url = \"http://sec-crack.cs.rmit.edu./SEC/2/\"; \n String password;\n\ \ String s = null;\n int num_tries = 0;\n \n try\n {\n\ \ \n BufferedReader dict_word = new BufferedReader\n \ \ (new FileReader (DICT_FILE));\n \n \n \ \ while((password = dict_word.readLine())!= null)\n { \n \ \ try \n {\n \n Process p = Runtime.getRuntime().exec(\"\ wget --http-user= --http-passwd=\" + password + \" \" + basic_url);\n \ \ \n BufferedReader stdInput = new BufferedReader(new \n \ \ InputStreamReader(p.getInputStream()));\n\n \ \ BufferedReader stdError = new BufferedReader(new \n InputStreamReader(p.getErrorStream()));\n\ \n \n while ((s = stdInput.readLine()) != null)\n\ \ {\n System.out.println(s);\n }\n\ \ \n \n while ((s = stdError.readLine())\ \ != null)\n {\n System.out.println(s);\n \ \ }\n\n try\n\t {\n p.waitFor();\ \ \n }\n catch (InterruptedException g) \n \ \ {\n } \n\n num_tries++;\n \ \ \n if((p.exitValue()) == 0) \n { \n \ \ System.out.println(\"**********PASSWORD IS: \" + password);\n\ \t System.out.println(\"**********NUMBER OF TRIES: \" + num_tries);\n\ \ System.exit(1);\n }\n }\n \ \ catch (IOException e)\n {\n System.out.println(\"\ exception happened - here's what I know: \");\n e.printStackTrace();\n\ \ System.exit(-1);\n }\n }\n \n \ \ System.out.println(\"DICTIONARY BRUTE FORCE UNABLE FIND PASSWORD\");\n \ \ System.out.println(\"**********Sorry, password was not found in dictionary\ \ file\");\n System.exit(1);\n\n }\n catch (FileNotFoundException\ \ exception)\n {\n System.out.println(exception);\n }\n \ \ catch (IOException exception)\n {\n System.out.println(exception);\n\ \ }\n }\n}\n \n" sentences: - "\n\nimport java.io.*;\nimport java.*;\n\npublic class BruteForce \n{\n public\ \ static void main(String args[]) \n {\n String s = null;\n String\ \ basic_url = \"http://sec-crack.cs.rmit.edu./SEC/2/\";\n\n \n String\ \ alphabets = new String(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\ );\n \n String password = null;\n int len = 0;\n int num_tries\ \ = 0;\n\n len = alphabets.length();\n \n \n for (int i=0;\ \ i\" + count++ );\n\t\t \t\tpass = f;\n\t\t\t\ \t\n\t\t\t\t\tfunction =\"wget --http-user= --http-passwd=\"+pass+\" http://sec-crack.cs.rmit.edu./SEC/2/\"\ ;\n\t\t\t\t\tprs = rtime.exec(function);\n\t\t\t\t \n\t\t\t\t\tInputStreamReader\ \ stre = new InputStreamReader(prs.getErrorStream());\n \ \ \t\t\tBufferedReader bread = new BufferedReader(stre);\n\t\t\t\t\twhile( (temp1\ \ = bread.readLine())!= null)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(temp1);\n\ \t\t\t\t\t\tif(temp1.equals(\"HTTP request sent, awaiting response... 200 OK\"\ ))\n \t\t\t\t{\n\t\t\t System.out.println(\"\ The password has is:\"+pass);\n \t\t\t System.exit(0);\n\ \ \t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\ \t\t}\n\t\t\t\n\t\t\tfr.print();\n\t\t\tbfread.close();\n\t\n\t\t\t}catch(Exception\ \ e){}\n\t}\n\t\n}\t\t\t\n" - "\n\nimport java.net.*;\nimport java.io.IOException;\nimport java.util.*;\nimport\ \ java.io.*;\npublic class BruteForce {\n \n \n \n String passwordLetters[]\ \ ={\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"\ m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"\ z\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"\ M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"\ Z\"};\n String password=\" \";\n static int counter;\n static int noOfAttempts;\n\ \ static String userName=\"\";\n HttpURLConnection u;\n boolean threadF,threadM;\n\ \ String passBase64;\n \n PasswordCrackThreadF passwordCrackThreadF;\n PasswordCrackThreadM\ \ passwordCrackThreadM;\n URL url;\n \n \n public BruteForce() {\n breakPassword();\n\ \ }\n\n public static void main (String args[]) {\n new BruteForce();\n\ \ }\n \n \n \n private void breakPassword() {\n int j;\n \n breakOneLetterPassword();\n\ \ \n breakTwoLetterPassword();\n \n \n \n\n passwordCrackThreadF\ \ = new PasswordCrackThreadF(0,26,counter++,passwordLetters,userName,this);\n\ \ \n passwordCrackThreadM = new PasswordCrackThreadM(26,52,counter++,passwordLetters,userName,this);\n\ \ \n passwordCrackThreadF.print();\n passwordCrackThreadM.print();\n\ \ }\n \n \n private void breakOneLetterPassword() { \n MyHttpURLConnection\ \ httpURLConnection;\n try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\ );\n\t \n\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\ \ u = (HttpURLConnection)url.openConnection();\n\t u.setRequestProperty(\"\ Authorization\", \" \" + passBase64);\n } catch (IOException io) {io.printStackTrace();}\n\ \ \n loop: for (int i=0;i<52;i++) {\n password\ \ = passwordLetters[i];\n\t\t \n\t\t password =\":\"+ password;\n \ \ try {\n \n\t \t u= (HttpURLConnection)url.openConnection();\n\ \t\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\ \ u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\ \t\t u.connect();\t\n\t\t noOfAttempts++; \n\t\t if (u.getContentLength()\ \ != 0) {\n\t\t \n\t\t if (u.getResponseCode()== HttpURLConnection.HTTP_OK\ \ ) {\n\t\t \n\t System.out.println (\"Your User\ \ Name : Password is \"+password);\n\t\t\t\t System.out.println(\" \");\n\t\ \t\t System.out.println(\" of Attempts / Requests \"+ noOfAttempts);\n\ \t\t\t \n\t\t\t System.exit(0);\n \n\t \ \ }\n\t\t }\n\t\t } catch (ProtocolException px) {px.printStackTrace();\n\ \ \n } catch ( NoRouteToHostException nr)\ \ {nr.printStackTrace();\n\t } catch (BindException e){e.printStackTrace();\n\ \t } catch (IndexOutOfBoundsException e3){e3.printStackTrace();\n\t\ \ } catch (IOException io) {io.printStackTrace();\n\t\t \n\t \ \ } finally {u.disconnect();\n\t }\n } \n }\n \n \ \ \n private void breakTwoLetterPassword() { \n MyHttpURLConnection \ \ httpURLConnection; \n try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\ );\n\t \n\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\ \ u = (HttpURLConnection)url.openConnection();\n\t u.setRequestProperty(\"\ Authorization\", \" \" + passBase64);\n } catch (IOException io) {io.printStackTrace();}\n\ \n \n loop: for (int i=0;i<52;i++) {\n for (int j=0;j<52;j++)\ \ {\n password = passwordLetters[i]+passwordLetters[j];\n\t\t\ \ \n\t\t password =\":\"+ password;\n\t\t \n\t\t \n\t \n \ \ try {\n\t\t u= (HttpURLConnection)url.openConnection();\n\ \t\t\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n\ \ u.setRequestProperty(\"Authorization\", \"\ \ \" + passBase64);\n\t\t\tu.connect();\n\t\t\tnoOfAttempts++;\n\t\t\t\n \ \ \t if (u.getContentLength() != 0) {\n\t\t if (u.getResponseCode()==\ \ HttpURLConnection.HTTP_OK ) {\n\t System.out.println\ \ (\"Your User Name : Password is \"+password); \n\t\t\t System.out.println(\"\ \ \");\n\t\t\t System.out.println(\" of Attempts / Requests \"+ noOfAttempts);\n\ \t\t\t \n\t\t\t System.exit(0);\n\t }\n\t\t }\n\ \t\t \n\t\t\n\t } catch (ProtocolException px) {px.printStackTrace();\n\ \ } catch ( NoRouteToHostException nr) {nr.printStackTrace();\n\ \t } catch (BindException e){e.printStackTrace();\n\t } catch\ \ (IndexOutOfBoundsException e3){e3.printStackTrace();\n\t } catch\ \ (IOException io) {io.printStackTrace();\n\t\t \n\t } finally {u.disconnect();\n\ \t }\n } \n }\n\n\n }\n}\n\nclass PasswordCrackThreadF\ \ extends Thread {\n \n \n \n private String passwordLetters[] ;\n \ \ private String password=\" \";\n private static String userName=\"\";\n\ \ private MyHttpURLConnection httpURLConnection;\n private URL url;\n\ \ \n BruteForce bruteForce;\n int count; \n String passBase64;\n \ \ private HttpURLConnection u;\n \n int start,stop;\n \n static boolean\ \ found;\n \n PasswordCrackThreadF(int start,int stop,int counter,String[]\n\ \ passwordLetters,String userName,BruteForce\ \ bruteForce) {\n this.start = start;\n this.stop = stop;\n \ \ this.passwordLetters =passwordLetters;\n this.userName=userName;\n \ \ count =counter;\n this.bruteForce=bruteForce; \n bruteForce.threadF=true;\n\ \t\n \n passBase64 = new bruteForce.misc.BASE64Encoder().encode(password.getBytes());\n\ \ try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\ );\n\t \n\n\t u = (HttpURLConnection)url.openConnection();\n \ \ \n\t u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\t\ \ \n\n } catch (IOException io) {io.printStackTrace();}\n\n }\n \n\ \ public synchronized void run() {\n \n outer : for (int i=0; i> 18;\n out [\ \ outIndex++ ] = alphabet [ bits6 ];\n bits6 = ( bits24 & 0x0003F000\ \ ) >> 12;\n out [ outIndex++ ] = alphabet [ bits6 ];\n \ \ bits6 = ( bits24 & 0x00000FC0 ) >> 6;\n out [ outIndex++\ \ ] = alphabet [ bits6 ];\n bits6 = ( bits24 & 0x0000003F );\n\ \ out [ outIndex++ ] = alphabet [ bits6 ];\n }\n\ \ \n if ( octetString.length - i == 2 )\n {\n \ \ \n bits24 = ( octetString [ i ] & 0xFF ) <<\ \ 16;\n bits24 |=( octetString [ i + 1 ] & 0xFF ) << 8;\n \ \ bits6=( bits24 & 0x00FC0000 )>> 18;\n out [ outIndex++\ \ ] = alphabet [ bits6 ];\n bits6 = ( bits24 & 0x0003F000 ) >>\ \ 12;\n out [ outIndex++ ] = alphabet [ bits6 ];\n \ \ bits6 = ( bits24 & 0x00000FC0 ) >> 6;\n out [ outIndex++\ \ ] = alphabet [ bits6 ];\n \n \n out [ outIndex++\ \ ] = '=';\n }\n else if ( octetString.length - i ==\ \ 1 )\n {\n \n bits24 = ( octetString\ \ [ i ] & 0xFF ) << 16;\n bits6=( bits24 & 0x00FC0000 )>> 18;\n\ \ out [ outIndex++ ] = alphabet [ bits6 ];\n \ \ bits6 = ( bits24 & 0x0003F000 ) >> 12;\n out [ outIndex++\ \ ] = alphabet [ bits6 ];\n \n \n out [ outIndex++\ \ ] = '=';\n out [ outIndex++ ] = '=';\n }\n \n\ \ return new String ( out );\n }\n }\n \n \n" sentences: - "\nimport java.net.*;\nimport java.io.*;\nimport java.misc.*;\n\npublic class\ \ Dictionary\n{\n public static void main (String args[])\n {\n \n \ \ String file = \"/usr/share/lib/dict/words\";\n FileReader fRead;\n \ \ BufferedReader buf;\n\n try\n {\n fRead = new FileReader(file);\n\ \ buf = new BufferedReader(fRead);\n String Password = \"\";\n\ \ int i=0;\n\n \n while( (Password = buf.readLine()) !=\ \ null)\n {\n i++;\n String a = myurl(\"http://sec-crack.cs.rmit.edu./SEC/2\"\ , \"\", Password, i);\n }\n }\n catch(FileNotFoundException\ \ e)\n {\n System.out.println(\"File not found\");\n }\n \ \ catch(IOException ioe)\n {\n System.out.println(\"IO Error \"\ \ + ioe);\n }\n }\n\n public static String encode (String source)\n \ \ {\n BASE64Encoder enc = new source.misc.BASE64Encoder();\n return(enc.encode(source.getBytes()));\n\ \ }\n\n public static String myurl (String url, String Name, String Password,\ \ int val )\n {\n String thisLine;\n String retVal;\n URL u;\n\ \ URLConnection uc;\n retVal = \"\";\n\n try\n {\n \ \ u = new URL(url);\n try\n {\n uc = u.openConnection();\n\ \ if (Name != null)\n {\n uc.setRequestProperty(\"\ Authorization\", \" \" + encode(Name + \":\" + Password));\n }\n \ \ InputStream content = (InputStream)uc.getInputStream();\n \ \ BufferedReader in = new BufferedReader (new InputStreamReader(content));\n\ \n String line;\n \n while ((line = in.readLine())\ \ != null)\n {\n retVal += line;\n System.out.println(line);\n\ \ System.out.println(\"password=\"+Password+\";number:\"+num);\n\ \ System.exit(0);\n }\n }\n catch (Exception\ \ e)\n {\n ;\n \n }\n }\n catch\ \ (MalformedURLException e)\n {\n return(url + \" is not a parseable\ \ URL\");\n }\n return retVal;\n }\n}\n\n\n" - "\nimport java.util.*;\n\npublic class CrackThread implements Runnable {\n\n \ \ private String strUsername;\n private String strURL;\n private int iSeed;\n\ \ private int iEnd;\n \n \n public CrackThread() {\n }\n \n\ \ public void setParams(String url, String username, int seed, int end) {\n\ \ strUsername = username;\n strURL = url;\n iSeed = seed;\n\ \ iEnd = end;\n }\n \n public void run() {\n Date dtStart,\ \ dtEnd;\n PasswordGen pwd = new PasswordGen();\n PasswordTest tester;\n\ \ int i=1;\n boolean bDone = false;\n Result res;\n\n \ \ dtStart = new Date();\n \n \n pwd.setSeed(iSeed);\n\ \ \n while(!bDone) {\n tester = new PasswordTest(strURL,\ \ strUsername, pwd.getNextPassword());\n \n bDone = tester;\n\ \ i++;\n \n \n if(i % 100 == 0)\n\ \ {\n System.out.println(pwd.getPassword());\n \ \ }\n \n if(bDone) {\n \n \ \ res = new Result(strURL, strUsername, pwd.getPassword(), dtStart, new\ \ Date(), i);\n System.out.print(res.toString());\n \ \ }\n else\n {\n \n }\n \ \ \n \n if( i >= iEnd) bDone = true;\n } \ \ \n }\n \n}\n" - "\nimport java.io.*;\nimport java.util.*;\n\npublic class BruteForce\n{\n private\ \ Cracker crack;\n private Vector clients;\n private int num;\n private\ \ int bigStart;\n\n public BruteForce()\n {\n int i, j;\n int start,\ \ finish;\n start=finish = 0;\n \n crack = new Cracker();\n \ \ crack.loadLetters();\n crack.loadPairs();\n crack.loadTriples();\n\ \ num = crack.getVictor().size();\n clients = new Vector( num);\n \ \ j = 0;\n \n bigStart = System.currentTimeMillis();\n for(\ \ i = 0; i < num; i++)\n {\n MyClient2 client = new MyClient2(this,\ \ i + 1, 80, (String)crack.getVictor().elementAt( i));\n \n \ \ clients.add( client);\n\t Thread t = new Thread( client);\n\t t.print();\n\ \ j++;\n if(j == 100)\n {\n t = System.currentTimeMillis();\n\ \ System.out.println(\"i = \"+i+\" \"+(String)crack.getVictor().elementAt(\ \ i));\n finish = t;\n while( (finish - t ) < 1000)\n\ \ {\n finish = System.currentTimeMillis();\n \ \ }\n j = 0;\n }\n \n }\n }\n \n public\ \ void retire(int MyClient2 )\n {\n int bigFinish;\n bigFinish = t.getTime();\n\ \ System.out.println(\" It took \"+(bigFinish - bigStart)/1000+\" \"+\"seconds\ \ crack password using brute force\");\n System.exit(0);\n }\n \n \ \ public static void main (String[] args)\n {\n BruteForce = new BruteForce();\n\ \ }\n}\n \n" - source_sentence: "\n\n\nimport java.io.InputStream;\nimport java.util.Properties;\n\ \nimport javax.naming.Context;\nimport javax.naming.InitialContext;\nimport javax.rmi.PortableRemoteObject;\n\ import javax.sql.DataSource;\n\n\n\n\n\n\npublic class MailsendPropertyHelper\ \ {\n\n\tprivate static Properties testProps;\n\n\tpublic MailsendPropertyHelper()\ \ {\n\t}\n\n\n\t\n\n\tpublic static String getProperty(String pKey){\n\t\ttry{\n\ \t\t\tinitProps();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.err.println(\"\ Error init'ing the watchddog Props\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\ return testProps.getProperty(pKey);\n\t}\n\n\n\tprivate static void initProps()\ \ throws Exception{\n\t\tif(testProps == null){\n\t\t\ttestProps = new Properties();\n\ \n\t\t\tInputStream fis =\n\t\t\t\tMailsendPropertyHelper.class.getResourceAsStream(\"\ /mailsend.properties\");\n\t\t\ttestProps.load(fis);\n\t\t}\n\t}\n}\n\n\n\n\n\n" sentences: - "import java.net.*;\nimport java.util.*;\n\npublic class BruteForce {\n\n public\ \ static void main(String[] args) {\n new CrackAttempt();\n }\n}\n\nclass\ \ CrackAttempt {\n public CrackAttempt() {\n final int MAX_LENGTH = 3;\n\ \ boolean auth = false;\n Date = new Date();\n boolean morePasswords\ \ = true;\n int passPtr = 0;\n StringBuffer validChars = new StringBuffer(\"\ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\");\n char[] password\ \ = new char[MAX_LENGTH];\n\n password[0] = validChars.charAt(0);\n \ \ while (!auth && morePasswords) {\n String resource = \"http://sec-crack.cs.rmit.edu./SEC/2/\"\ ;\n try {\n \n Authenticator.setDefault(new CrackAuth(password));\n\ \ URL url = new URL(resource);\n HttpURLConnection conn\ \ = (HttpURLConnection)url.openConnection();\n conn.setRequestMethod(\"\ HEAD\");\n if (conn.getResponseCode() == HttpURLConnection.HTTP_OK)\ \ {\n System.out.println(\"cracked with \" + new String(password));\n\ \ auth = true;\n }\n } catch (Exception e) {\n\ \ System.out.println(\" was exception: \" + e.getMessage());\n \ \ }\n int count = passPtr;\n while (true) {\n \ \ if (password[count] == validChars.charAt(validChars.length() - 1)) {\n \ \ password[count] = validChars.charAt(0);\n count--;\n\ \ } else {\n password[count] = validChars.charAt(validChars.indexOf(String.valueOf(password[count]))\ \ + 1);\n break;\n }\n if (count < 0) {\n\ \ \n if (passPtr < MAX_LENGTH - 1) {\n \ \ passPtr++;\n password[passPtr] = validChars.charAt(0);\n\ \ } else {\n morePasswords = false;\n \ \ }\n break;\n }\n }\n \n }\ \ \n if (!auth) {\n System.out.println(\"Unable determine password\"\ );\n } else {\n time = (new Date()).getTime() - start.getTime();\n\ \ System.out.println(\"it took \" + String.valueOf(time) + \" milliseconds\ \ crack the password\");\n }\n }\n}\n\nclass CrackAuth extends Authenticator\ \ {\n char[] password;\n public CrackAuth(char[] password) {\n this.password\ \ = password;\n }\n\n protected PasswordAuthentication getPasswordAuthentication()\n\ \ {\n String user = \"\";\n return new PasswordAuthentication(user,\ \ password);\n }\n}\n" - "\n\nimport java.io.*;\nimport java.*;\nimport java.net.*;\nimport java.util.*;\n\ \npublic class Dictionary {\n public static void main (String[] args) throws\ \ IOException {\n BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));\n\ \n d = new Date().getTime();\n FileReader fr = new FileReader(\"\ /usr/share/lib/dict/words\");\n BufferedReader bufr = new BufferedReader(fr);\n\ \ String word = bufr.readLine(); \n int total = 960;\n\ \ String[] pws = new String[total];\n int count = 0;\n while\ \ (word!=null){\n if (word.length()<=3) { pws[count] = word; count++;}\n\ \tword = bufr.readLine();\n }\n \n int i=0;\n int response\ \ = 0;\n for (i=0;i= bytes.length) {\n b2 = 0;\n b3\ \ = 0;\n pad = 2;\n }\n else {\n b2 = bytes [i++];\n\ \ if (i >= bytes.length) {\n b3 = 0;\n pad =\ \ 1;\n }\n else\n b3 = bytes [i++];\n \ \ }\n byte c1 = (byte)(b1 >> 2);\n byte c2 = (byte)(((b1 & 0x3)\ \ << 4) | (b2 >> 4));\n byte c3 = (byte)(((b2 & 0xf) << 2) | (b3 >> 6));\n\ \ byte c4 = (byte)(b3 & 0x3f);\n encodedString += base64Array [c1];\n\ \ encodedString += base64Array [c2];\n switch (pad) {\n case\ \ 0:\n encodedString += base64Array [c3];\n encodedString +=\ \ base64Array [c4];\n break;\n case 1:\n encodedString\ \ += base64Array [c3];\n encodedString += \"=\";\n break;\n\ \ case 2:\n encodedString += \"==\";\n break;\n \ \ }\n }\n return encodedString;\n }\n }\n\n" - "\n\nimport java.io.*;\nimport java.*;\n\npublic class BruteForce \n{\n public\ \ static void main(String args[]) \n {\n String s = null;\n String\ \ basic_url = \"http://sec-crack.cs.rmit.edu./SEC/2/\";\n\n \n String\ \ alphabets = new String(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\ );\n \n String password = null;\n int len = 0;\n int num_tries\ \ = 0;\n\n len = alphabets.length();\n \n \n for (int i=0;\ \ i 1) {\n\n }\n } else {\n \ \ \n \n System.out.println (\"What the?...\ \ The server replied with unexpected reponse.\" );\n System.out.println\ \ (\" Unexpected Error Occured While Attempting Connect \" + url);\n \ \ System.out.println (\"Connection Status: \" + responseCode + responseMsg);\n\ \ System.out.println (\"Unfortunately the password could not recovered.\"\ );\n System.exit( 0 );\n }\n\n i++;\n\n \ \ } catch(MalformedURLException e) {\n System.out.println(\"Opps,\ \ the URL \" + host + \" is not valid.\");\n System.out.println(\"Please\ \ check the URL and try again.\");\n } catch(IOException e) {\n \ \ System.out.println(\", 't connect \" + host + \".\");\n System.out.println(\"\ Please check the URL and try again.\");\n System.out.println(\"Other\ \ possible causes include website is currently unavailable\");\n System.out.println(\"\ \ have internet connection problem.\");\n } \n\n } while(realm !=\ \ null); \n\n\n }\n}" pipeline_tag: sentence-similarity library_name: sentence-transformers metrics: - cosine_accuracy - cosine_accuracy_threshold - cosine_f1 - cosine_f1_threshold - cosine_precision - cosine_recall - cosine_ap - cosine_mcc model-index: - name: SentenceTransformer based on huggingface/CodeBERTa-small-v1 results: - task: type: binary-classification name: Binary Classification dataset: name: binary classification evaluator type: binary-classification-evaluator metrics: - type: cosine_accuracy value: 0.999534450651769 name: Cosine Accuracy - type: cosine_accuracy_threshold value: 0.8751956224441528 name: Cosine Accuracy Threshold - type: cosine_f1 value: 0.9995346672871103 name: Cosine F1 - type: cosine_f1_threshold value: 0.8751956224441528 name: Cosine F1 Threshold - type: cosine_precision value: 0.9990697674418605 name: Cosine Precision - type: cosine_recall value: 1.0 name: Cosine Recall - type: cosine_ap value: 0.9999512493871627 name: Cosine Ap - type: cosine_mcc value: 0.9990693343726054 name: Cosine Mcc --- # SentenceTransformer based on huggingface/CodeBERTa-small-v1 This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [huggingface/CodeBERTa-small-v1](https://huggingface.co/huggingface/CodeBERTa-small-v1). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more. ## Model Details ### Model Description - **Model Type:** Sentence Transformer - **Base model:** [huggingface/CodeBERTa-small-v1](https://huggingface.co/huggingface/CodeBERTa-small-v1) - **Maximum Sequence Length:** 512 tokens - **Output Dimensionality:** 768 dimensions - **Similarity Function:** Cosine Similarity ### Model Sources - **Documentation:** [Sentence Transformers Documentation](https://sbert.net) - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers) - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers) ### Full Model Architecture ``` SentenceTransformer( (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'RobertaModel'}) (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True}) ) ``` ## Usage ### Direct Usage (Sentence Transformers) First install the Sentence Transformers library: ```bash pip install -U sentence-transformers ``` Then you can load this model and run inference. ```python from sentence_transformers import SentenceTransformer # Download from the 🤗 Hub model = SentenceTransformer("buelfhood/SOCO-Java-CODEBERTA-CONTRASTIVE-PAIRS-E1-B16-LR2e-05-Split0.1") # Run inference sentences = [ '\n\nimport java.io.*;\nimport java.net.*;\nimport java.misc.BASE64Encoder;\n\npublic class Dictionary\n{\n public Dictionary()\n {}\n\n public boolean fetchURL(String urlString,String username,String password)\n {\n StringWriter sw= new StringWriter();\n PrintWriter pw = new PrintWriter();\n try{\n URL url=new URL(urlString); \n String userPwd= username+":"+password;\n\n \n \n \n \n\n BASE64Encoder encoder = new BASE64Encoder();\n String encodedStr = encoder.encode (userPwd.getBytes());\n System.out.println("Original String = " + userPwd);\n\t System.out.println("Encoded String = " + encodedStr);\n\n HttpURLConnection huc=(HttpURLConnection) url.openConnection(); \n huc.setRequestProperty( "Authorization"," "+encodedStr); \n InputStream content = (InputStream)huc.getInputStream();\n BufferedReader in =\n new BufferedReader (new InputStreamReader (content));\n String line;\n while ((line = in.readLine()) != null) {\n pw.println (line);\n System.out.println("");\n System.out.println(sw.toString());\n }return true;\n } catch (MalformedURLException e) {\n pw.println ("Invalid URL");\n return false;\n } catch (IOException e) {\n pw.println ("Error URL");\n return false;\n }\n\n }\n\n public void getPassword()\n {\n String dictionary="words";\n String urlString="http://sec-crack.cs.rmit.edu./SEC/2/";\n String login="";\n String pwd=" ";\n\n try\n {\n BufferedReader inputStream=new BufferedReader(new FileReader(dictionary));\n startTime=System.currentTimeMillis();\n while (pwd!=null)\n {\n pwd=inputStream.readLine();\n if(this.fetchURL(urlString,login,pwd))\n {\n finishTime=System.currentTimeMillis();\n System.out.println("Finally I gotta it, password is : "+pwd);\n System.out.println("The time for cracking password is: "+(finishTime-startTime) + " milliseconds");\n System.exit(1);\n } \n\n }\n inputStream.close();\n }\n catch(FileNotFoundException e)\n {\n System.out.println("Dictionary not found.");\n }\n catch(IOException e)\n {\n System.out.println("Error dictionary");\n }\n }\n\n public static void main(String[] arguments)\n {\n BruteForce bf=new BruteForce();\n bf.getPassword();\n } \n}', '\n\nimport java.io.*;\nimport java.*;\n\npublic class BruteForce \n{\n public static void main(String args[]) \n {\n String s = null;\n String basic_url = "http://sec-crack.cs.rmit.edu./SEC/2/";\n\n \n String alphabets = new String("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");\n \n String password = null;\n int len = 0;\n int num_tries = 0;\n\n len = alphabets.length();\n \n \n for (int i=0; i 1) {\n\n }\n } else {\n \n \n System.out.println ("What the?... The server replied with unexpected reponse." );\n System.out.println (" Unexpected Error Occured While Attempting Connect " + url);\n System.out.println ("Connection Status: " + responseCode + responseMsg);\n System.out.println ("Unfortunately the password could not recovered.");\n System.exit( 0 );\n }\n\n i++;\n\n } catch(MalformedURLException e) {\n System.out.println("Opps, the URL " + host + " is not valid.");\n System.out.println("Please check the URL and try again.");\n } catch(IOException e) {\n System.out.println(", \'t connect " + host + ".");\n System.out.println("Please check the URL and try again.");\n System.out.println("Other possible causes include website is currently unavailable");\n System.out.println(" have internet connection problem.");\n } \n\n } while(realm != null); \n\n\n }\n}', ] embeddings = model.encode(sentences) print(embeddings.shape) # [3, 768] # Get the similarity scores for the embeddings similarities = model.similarity(embeddings, embeddings) print(similarities) # tensor([[1.0000, 0.2589, 0.2759], # [0.2589, 1.0000, 0.2076], # [0.2759, 0.2076, 1.0000]]) ``` ## Evaluation ### Metrics #### Binary Classification * Dataset: `binary-classification-evaluator` * Evaluated with [BinaryClassificationEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator) | Metric | Value | |:--------------------------|:--------| | cosine_accuracy | 0.9995 | | cosine_accuracy_threshold | 0.8752 | | cosine_f1 | 0.9995 | | cosine_f1_threshold | 0.8752 | | cosine_precision | 0.9991 | | cosine_recall | 1.0 | | **cosine_ap** | **1.0** | | cosine_mcc | 0.9991 | ## Training Details ### Training Dataset #### Unnamed Dataset * Size: 77,328 training samples * Columns: text_1, text_2, and label * Approximate statistics based on the first 1000 samples: | | text_1 | text_2 | label | |:--------|:-------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:------------------------------------------------| | type | string | string | int | | details |
  • min: 51 tokens
  • mean: 467.45 tokens
  • max: 512 tokens
|
  • min: 51 tokens
  • mean: 464.45 tokens
  • max: 512 tokens
|
  • 0: ~50.00%
  • 1: ~50.00%
| * Samples: | text_1 | text_2 | label | |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------| |

import java.io.*;
import java.net.*;
import java.misc.BASE64Encoder;

public class Dictionary
{
public Dictionary()
{}

public boolean fetchURL(String urlString,String username,String password)
{
StringWriter sw= new StringWriter();
PrintWriter pw = new PrintWriter();
try{
URL url=new URL(urlString);
String userPwd= username+":"+password;






BASE64Encoder encoder = new BASE64Encoder();
String encodedStr = encoder.encode (userPwd.getBytes());
System.out.println("Original String = " + userPwd);
System.out.println("Encoded String = " + encodedStr);

HttpURLConnection huc=(HttpURLConnection) url.openConnection();
huc.setRequestProperty( "Authorization"," "+encodedStr);
InputStream content = (InputStream)huc.getInputStream();
BufferedReader in =
new BufferedReader (new InputStreamReader (content));
String line;
while ((line = in.readLine())...
|

import java.io.*;
import java.net.*;
import java.misc.BASE64Encoder;

public class BruteForce
{
public BruteForce()
{}

public boolean fetchURL(String urlString,String username,String password)
{
StringWriter = new StringWriter();
PrintWriter pw = new PrintWriter();
try{
URL url=new URL(urlString);
String userPwd= username+":"+password;






BASE64Encoder encoder = new BASE64Encoder();
String encodedStr = encoder.encode (userPwd.getBytes());
System.out.println("Original String = " + userPwd);
System.out.println("Encoded String = " + encodedStr);

HttpURLConnection huc=(HttpURLConnection) url.openConnection();
huc.setRequestProperty( "Authorization"," "+encodedStr);
InputStream content = (InputStream)huc.getInputStream();
BufferedReader in =
new BufferedReader (new InputStreamReader (content));
String line;
while ((line = in.readLine()) ...
| 1 | |

import java.io.*;
import java.net.*;
import java.misc.BASE64Encoder;

public class Dictionary
{
public Dictionary()
{}

public boolean fetchURL(String urlString,String username,String password)
{
StringWriter sw= new StringWriter();
PrintWriter pw = new PrintWriter();
try{
URL url=new URL(urlString);
String userPwd= username+":"+password;






BASE64Encoder encoder = new BASE64Encoder();
String encodedStr = encoder.encode (userPwd.getBytes());
System.out.println("Original String = " + userPwd);
System.out.println("Encoded String = " + encodedStr);

HttpURLConnection huc=(HttpURLConnection) url.openConnection();
huc.setRequestProperty( "Authorization"," "+encodedStr);
InputStream content = (InputStream)huc.getInputStream();
BufferedReader in =
new BufferedReader (new InputStreamReader (content));
String line;
while ((line = in.readLine())...
|

import java.net.*;
import java.io.*;
import java.util.*;

public class Dictionary{

private static URL location;
private static String user;
private BufferedReader input;
private static BufferedReader dictionary;
private int maxLetters = 3;



public Dictionary() {

Authenticator.setDefault(new MyAuthenticator ());

startTime = System.currentTimeMillis();
boolean passwordMatched = false;
while (!passwordMatched) {
try {
input = new BufferedReader(new InputStreamReader(location.openStream()));
String line = input.readLine();
while (line != null) {
System.out.println(line);
line = input.readLine();
}
input.close();
passwordMatched = true;
}
catch (ProtocolException e)
{


}
catch (ConnectException e) {
System.out.println("Failed connect");
}
catch (IOException e) ...
| 0 | |


import java.io.InputStream;
import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.sql.DataSource;





public class WatchdogPropertyHelper {

private static Properties testProps;



public WatchdogPropertyHelper() {
}




public static String getProperty(String pKey){
try{
initProps();
}
catch(Exception e){
System.err.println("Error init'ing the watchddog Props");
e.printStackTrace();
}
return testProps.getProperty(pKey);
}


private static void initProps() throws Exception{
if(testProps == null){
testProps = new Properties();

InputStream fis =
WatchdogPropertyHelper.class.getResourceAsStream("/watchdog.properties");
testProps.load(fis);
}
}
}
|



import java.io.InputStream;
import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.sql.DataSource;




public class BruteForcePropertyHelper {

private static Properties bruteForceProps;



public BruteForcePropertyHelper() {
}




public static String getProperty(String pKey){
try{
initProps();
}
catch(Exception e){
System.err.println("Error init'ing the burteforce Props");
e.printStackTrace();
}
return bruteForceProps.getProperty(pKey);
}


private static void initProps() throws Exception{
if(bruteForceProps == null){
bruteForceProps = new Properties();

InputStream fis =
BruteForcePropertyHelper.class.getResourceAsStream("/bruteforce.properties");
bruteForceProps.load(fis);
}
}
}

| 1 | * Loss: [ContrastiveLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters: ```json { "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE", "margin": 0.5, "size_average": true } ``` ### Evaluation Dataset #### Unnamed Dataset * Size: 8,592 evaluation samples * Columns: text_1, text_2, and label * Approximate statistics based on the first 1000 samples: | | text_1 | text_2 | label | |:--------|:------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:------------------------------------------------| | type | string | string | int | | details |
  • min: 51 tokens
  • mean: 469.8 tokens
  • max: 512 tokens
|
  • min: 51 tokens
  • mean: 461.39 tokens
  • max: 512 tokens
|
  • 0: ~50.00%
  • 1: ~50.00%
| * Samples: | text_1 | text_2 | label | |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------| |





import java.util.*;
import java.io.*;

public class WatchDog
{

public static void main(String args[])
{

Runtime rt1 = Runtime.getRuntime();
Process prss1= null;

try
{
prss1 = rt1.exec("wget -R mpg,mpeg, --output-document=first.html http://www.cs.rmit.edu./students/");
}catch(java.io.IOException e){}

MyWatchDogTimer w = new MyWatchDogTimer();
Timer time = new Timer();
time.schedule(w,864000000,864000000);


}
}
|




import java.util.*;
import java.io.*;

public class MyTimer
{

public static void main(String args[])
{
Watchdog watch = new Watchdog();
Timer time = new Timer();
time.schedule(watch,864000000,864000000);


}
}
| 1 | |





import java.util.*;
import java.io.*;

public class WatchDog
{

public static void main(String args[])
{

Runtime rt1 = Runtime.getRuntime();
Process prss1= null;

try
{
prss1 = rt1.exec("wget -R mpg,mpeg, --output-document=first.html http://www.cs.rmit.edu./students/");
}catch(java.io.IOException e){}

MyWatchDogTimer w = new MyWatchDogTimer();
Timer time = new Timer();
time.schedule(w,864000000,864000000);


}
}
| import java.net.*;
import java.io.*;
import java.util.Vector;
import java.util.Date;
import java.security.*;












public class Dictionary {
public static BufferedReader in;


public static void main(String[] args) throws Exception {
String baseURL = "http://sec-crack.cs.rmit.edu./SEC/2/index.php";
int count=0;
Date date = new Date();
startTime=date.getTime();
int LIMITINMINUTES=45;
int TIMELIMIT=LIMITINMINUTES*1000*60;
boolean timedOut=false;
boolean found=false;


Vector dictionary=new Vector(readWords());
System.out.println("Words in dictionary: "+dictionary.size());







while (found==false && timedOut==false && dictionary.elementAt(count)!=null) {

Date endDate = new Date();
endTime=endDate.getTime();
if (endTime>(TIMELIMIT+startTime)){
System.out.println("Timed out");
timedOut=true;
}

String password = "";

...
| 0 | |


import java.io.InputStream;
import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.sql.DataSource;






public class MailsendPropertyHelper {

private static Properties testProps;

public MailsendPropertyHelper() {
}




public static String getProperty(String pKey){
try{
initProps();
}
catch(Exception e){
System.err.println("Error init'ing the watchddog Props");
e.printStackTrace();
}
return testProps.getProperty(pKey);
}


private static void initProps() throws Exception{
if(testProps == null){
testProps = new Properties();

InputStream fis =
MailsendPropertyHelper.class.getResourceAsStream("/mailsend.properties");
testProps.load(fis);
}
}
}





|



import java.io.InputStream;
import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.sql.DataSource;




public class BruteForcePropertyHelper {

private static Properties bruteForceProps;



public BruteForcePropertyHelper() {
}




public static String getProperty(String pKey){
try{
initProps();
}
catch(Exception e){
System.err.println("Error init'ing the burteforce Props");
e.printStackTrace();
}
return bruteForceProps.getProperty(pKey);
}


private static void initProps() throws Exception{
if(bruteForceProps == null){
bruteForceProps = new Properties();

InputStream fis =
BruteForcePropertyHelper.class.getResourceAsStream("/bruteforce.properties");
bruteForceProps.load(fis);
}
}
}

| 1 | * Loss: [ContrastiveLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters: ```json { "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE", "margin": 0.5, "size_average": true } ``` ### Training Hyperparameters #### Non-Default Hyperparameters - `eval_strategy`: steps - `per_device_train_batch_size`: 16 - `per_device_eval_batch_size`: 16 - `learning_rate`: 2e-05 - `num_train_epochs`: 1 - `warmup_ratio`: 0.1 - `fp16`: True - `batch_sampler`: no_duplicates #### All Hyperparameters
Click to expand - `overwrite_output_dir`: False - `do_predict`: False - `eval_strategy`: steps - `prediction_loss_only`: True - `per_device_train_batch_size`: 16 - `per_device_eval_batch_size`: 16 - `per_gpu_train_batch_size`: None - `per_gpu_eval_batch_size`: None - `gradient_accumulation_steps`: 1 - `eval_accumulation_steps`: None - `torch_empty_cache_steps`: None - `learning_rate`: 2e-05 - `weight_decay`: 0.0 - `adam_beta1`: 0.9 - `adam_beta2`: 0.999 - `adam_epsilon`: 1e-08 - `max_grad_norm`: 1.0 - `num_train_epochs`: 1 - `max_steps`: -1 - `lr_scheduler_type`: linear - `lr_scheduler_kwargs`: {} - `warmup_ratio`: 0.1 - `warmup_steps`: 0 - `log_level`: passive - `log_level_replica`: warning - `log_on_each_node`: True - `logging_nan_inf_filter`: True - `save_safetensors`: True - `save_on_each_node`: False - `save_only_model`: False - `restore_callback_states_from_checkpoint`: False - `no_cuda`: False - `use_cpu`: False - `use_mps_device`: False - `seed`: 42 - `data_seed`: None - `jit_mode_eval`: False - `use_ipex`: False - `bf16`: False - `fp16`: True - `fp16_opt_level`: O1 - `half_precision_backend`: auto - `bf16_full_eval`: False - `fp16_full_eval`: False - `tf32`: None - `local_rank`: 0 - `ddp_backend`: None - `tpu_num_cores`: None - `tpu_metrics_debug`: False - `debug`: [] - `dataloader_drop_last`: False - `dataloader_num_workers`: 0 - `dataloader_prefetch_factor`: None - `past_index`: -1 - `disable_tqdm`: False - `remove_unused_columns`: True - `label_names`: None - `load_best_model_at_end`: False - `ignore_data_skip`: False - `fsdp`: [] - `fsdp_min_num_params`: 0 - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False} - `fsdp_transformer_layer_cls_to_wrap`: None - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None} - `parallelism_config`: None - `deepspeed`: None - `label_smoothing_factor`: 0.0 - `optim`: adamw_torch_fused - `optim_args`: None - `adafactor`: False - `group_by_length`: False - `length_column_name`: length - `ddp_find_unused_parameters`: None - `ddp_bucket_cap_mb`: None - `ddp_broadcast_buffers`: False - `dataloader_pin_memory`: True - `dataloader_persistent_workers`: False - `skip_memory_metrics`: True - `use_legacy_prediction_loop`: False - `push_to_hub`: False - `resume_from_checkpoint`: None - `hub_model_id`: None - `hub_strategy`: every_save - `hub_private_repo`: None - `hub_always_push`: False - `hub_revision`: None - `gradient_checkpointing`: False - `gradient_checkpointing_kwargs`: None - `include_inputs_for_metrics`: False - `include_for_metrics`: [] - `eval_do_concat_batches`: True - `fp16_backend`: auto - `push_to_hub_model_id`: None - `push_to_hub_organization`: None - `mp_parameters`: - `auto_find_batch_size`: False - `full_determinism`: False - `torchdynamo`: None - `ray_scope`: last - `ddp_timeout`: 1800 - `torch_compile`: False - `torch_compile_backend`: None - `torch_compile_mode`: None - `include_tokens_per_second`: False - `include_num_input_tokens_seen`: False - `neftune_noise_alpha`: None - `optim_target_modules`: None - `batch_eval_metrics`: False - `eval_on_start`: False - `use_liger_kernel`: False - `liger_kernel_config`: None - `eval_use_gather_object`: False - `average_tokens_across_devices`: False - `prompts`: None - `batch_sampler`: no_duplicates - `multi_dataset_batch_sampler`: proportional - `router_mapping`: {} - `learning_rate_mapping`: {}
### Training Logs | Epoch | Step | Training Loss | Validation Loss | binary-classification-evaluator_cosine_ap | |:------:|:----:|:-------------:|:---------------:|:-----------------------------------------:| | 0.0207 | 100 | 0.0203 | - | - | | 0.0414 | 200 | 0.0079 | - | - | | 0.0621 | 300 | 0.0032 | - | - | | 0.0828 | 400 | 0.0018 | - | - | | 0.1035 | 500 | 0.001 | 0.0007 | 0.9999 | | 0.1241 | 600 | 0.0007 | - | - | | 0.1448 | 700 | 0.0005 | - | - | | 0.1655 | 800 | 0.0006 | - | - | | 0.1862 | 900 | 0.0004 | - | - | | 0.2069 | 1000 | 0.0006 | 0.0003 | 1.0000 | | 0.2276 | 1100 | 0.0005 | - | - | | 0.2483 | 1200 | 0.0002 | - | - | | 0.2690 | 1300 | 0.0004 | - | - | | 0.2897 | 1400 | 0.0004 | - | - | | 0.3104 | 1500 | 0.0004 | 0.0002 | 1.0000 | | 0.3311 | 1600 | 0.0002 | - | - | | 0.3517 | 1700 | 0.0004 | - | - | | 0.3724 | 1800 | 0.0003 | - | - | | 0.3931 | 1900 | 0.0002 | - | - | | 0.4138 | 2000 | 0.0004 | 0.0002 | 1.0000 | | 0.4345 | 2100 | 0.0001 | - | - | | 0.4552 | 2200 | 0.0003 | - | - | | 0.4759 | 2300 | 0.0002 | - | - | | 0.4966 | 2400 | 0.0004 | - | - | | 0.5173 | 2500 | 0.0003 | 0.0002 | 0.9999 | | 0.5380 | 2600 | 0.0001 | - | - | | 0.5587 | 2700 | 0.0003 | - | - | | 0.5794 | 2800 | 0.0004 | - | - | | 0.6000 | 2900 | 0.0002 | - | - | | 0.6207 | 3000 | 0.0003 | 0.0002 | 1.0000 | | 0.6414 | 3100 | 0.0003 | - | - | | 0.6621 | 3200 | 0.0002 | - | - | | 0.6828 | 3300 | 0.0004 | - | - | | 0.7035 | 3400 | 0.0003 | - | - | | 0.7242 | 3500 | 0.0004 | 0.0002 | 1.0000 | | 0.7449 | 3600 | 0.0002 | - | - | | 0.7656 | 3700 | 0.0002 | - | - | | 0.7863 | 3800 | 0.0003 | - | - | | 0.8070 | 3900 | 0.0003 | - | - | | 0.8276 | 4000 | 0.0002 | 0.0001 | 1.0000 | | 0.8483 | 4100 | 0.0002 | - | - | | 0.8690 | 4200 | 0.0003 | - | - | | 0.8897 | 4300 | 0.0002 | - | - | | 0.9104 | 4400 | 0.0003 | - | - | | 0.9311 | 4500 | 0.0002 | 0.0002 | 1.0000 | | 0.9518 | 4600 | 0.0001 | - | - | | 0.9725 | 4700 | 0.0005 | - | - | | 0.9932 | 4800 | 0.0004 | - | - | ### Framework Versions - Python: 3.11.11 - Sentence Transformers: 5.1.1 - Transformers: 4.56.2 - PyTorch: 2.8.0.dev20250319+cu128 - Accelerate: 1.10.1 - Datasets: 4.1.1 - Tokenizers: 0.22.1 ## Citation ### BibTeX #### Sentence Transformers ```bibtex @inproceedings{reimers-2019-sentence-bert, title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks", author = "Reimers, Nils and Gurevych, Iryna", booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing", month = "11", year = "2019", publisher = "Association for Computational Linguistics", url = "https://arxiv.org/abs/1908.10084", } ``` #### ContrastiveLoss ```bibtex @inproceedings{hadsell2006dimensionality, author={Hadsell, R. and Chopra, S. and LeCun, Y.}, booktitle={2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06)}, title={Dimensionality Reduction by Learning an Invariant Mapping}, year={2006}, volume={2}, number={}, pages={1735-1742}, doi={10.1109/CVPR.2006.100} } ```