Jump to content

Karaethon

Members
  • Content Count

    83
  • Joined

  • Last visited

Everything posted by Karaethon

  1. Karaethon

    Is 'password_hash' broken?

    I copied the code for password_hash at php.net: <?php /** * In this case, we want to increase the default cost for BCRYPT to 12. * Note that we also switched to BCRYPT, which will always be 60 characters. */ $options = [ 'cost' => 12, ]; echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options); ?> and changed it for use in my login page: $options = ['cost' => 12,]; $user = mysqli_real_escape_string($db_link,$_GET['username']); $pass = password_hash($_GET['password'], PASSWORD_BCRYPT, $options); but my page keeps saying invalid user/pass. Upon echoing the $pass I find that the result changes EACH time. so I created a test page that runs the code from php.net (verbatim code) 20x and I got: [pre] $2y$10$Nlf0J520viR4C5jd3nIdd.6M3OMKACx503Jm3PiXDYZIs.13XAheq $2y$10$SO1ip3JI.EGjUJb3JYUDSeAUszg6A3UBX9b.ENk2aythAuxQ1apxS $2y$10$Ub7cQSbFWXhkLrzm3ldGGe8FfgsOjS99vgj9l801yqXgPjvJmVpsm $2y$10$8fNzz/tmrg8tLdHOk0r7GOh0j1frKN3ujA/qzrFHi/s22jMO/hbri $2y$10$o.5LnDxkhw/YNxJT16fuIOiQbnhHKs51SqFTqQ3KsflY6nYV.HLLm $2y$10$zQZiauRe6tuF2rGd1XGcO.E7ekhfP68Sqih8ll9Om7n5c2NO3tPSu $2y$10$uLZXDAQu14EW8P4CMMICBuvRv0wOEAxghzJV1c9UuNK7yTRJNNdjO $2y$10$P6Uy4/PDOnE9zv/VxRAWFebKY/qYXj1unIrTvV42xUxe.zXx3ut2W $2y$10$uHb8qdh3CGe0BkXdyuThHu0vgAH5bxEPYMe0VK410Q7xqcAlC.xuy $2y$10$xXwbec0Cn0JcMorGgmmRY.qHW.N1pNoYq.2V.IAQHsCDYPXtgQyJ6 $2y$10$w88m.M6BmVVoYYBhM1IAquOIb4NH9n093nQmdzhKm0Fq2ykgcZFZm $2y$10$IkVTs7.z4rZt5/rkgRQnKeXfINb7VTqXxTDRZB9caR4X0rwKtdhIW $2y$10$XyjX0X0I.l4Ct9eF4zhhz.S5Cg/Ppqf3veL9ciehjBr/2Rp8usPCm $2y$10$iJkhIWl95TVlA4hw2nltd./YmyXA2.abqTu8WFs/YuEvJsndosv6W $2y$10$kwVNtAaKxG8z2m.D0evl..Xx64NWPxbFAIBjCDLBfgiJncgniBB7S $2y$10$m8ZyiI7HhXutyTZGySit/O3lmAGsIlfRqEcYc7eCV2XS9TS1Sw9/y $2y$10$uYDilXy1HKT9M6DiPUhAe.3W5teCpkTF4x5UgVYiJctz4HXNMzU9e $2y$10$0HDD2quyh2AfMeF41PbKTu7PGTPn2fcl42HLxweaIHay9KbPDrEh6 $2y$10$qc0Kt5VtkrslpLlQmvq5a.dboTbf8qEif9KOwYwjoGGh6Q.xoN8JK [/pre] Is password_hash broken? or am I mistaken to think that it's supposed to return the same output everytime fror the same input?
  2. Karaethon

    Is 'password_hash' broken?

    Ahhh. ok... so I use _hash when the user registers or edits their password and _verify when they log in? Kinda wish the php documentation said something about that, or at least I didn't catch it if it did.
  3. I have a DB of data: article-id, section-id, subsection-id, article-text. When a row is fetched I am displaying article, section, subsection as <h3>, <h4>, <h5> and then text in a <p>. Before outputting the text I want to scan it for other articles, sections, or subsections it may reference then turn that reference into a hyperlink. I read the PHP documentation but I can't find anything that translates to the basic commands of instring, indexof, and left/mid/right. Example: 1. Article Name 100. Article 1, section 1 100.a article 1, section 1, subsection a Text blah blah blah 105.f blah blah blah I want to find that 105.f and turn it into a link. All my articles, sections, and subsections are in the DB so I know I can use an array of the number values as my items to look for, but I can't figure out how to look.
  4. Karaethon

    Finding occurrence of values in a string.

    Ok, so I've been reading about regex and I think this is the fix... am I wayyyyyyy wrong? (\d{3})\.(\d?)(\w?)
  5. Karaethon

    script to fade bg color on page

    I really like this keyframes animation stuff, I even came up with, and coded, a heartbeat for my image on my page, is there a way to put in a delay between intervals so i can change the heart rate without having to adjust the percentages every time i adjust the cycle length?
  6. In general if I know how to do something I want to do I can code it in a language I'm less than fluent in, if I am fluent in a language I can figure out how to code something I want to do but don't know very well how to do it, but this time I have almost no clue how to do what I want to do and very limited fluency in JS. I want a script that will slowly fade from one color (red, green, blue, white, black) to a neutral color (grey) and then fade into one of the randomly selected other 4 colors. Then repeat. Forever. So like Rd>gy>wt>bu>gy>bk etc. I have no clue what to do, if you can help I will be grateful for all time. Oh, and I need to make sure the text color is always contrasting so it can be read, so I need to adjust that too?
  7. Karaethon

    Finding occurrence of values in a string.

    Oh Shoot. I just noticed I had a small typo, its ###.# or ###.#L. How does that change the regex? Ok, I used what you wrote and it does (almost) exactly what I want, the only error was (my fault completely) it did not capture the trailing 6 on a reference to 100.6 and it did not capture the trailing i on 100.4i. I bet its an easy fix if I grocked regex. But I don't (yet).
  8. Karaethon

    Finding occurrence of values in a string.

    Do they always start with a series of digits? If so, what is the minimum/maximum number of digits? Are the digits always followed by a period? Is the period always followed by a letter? If so, what are the valid letters and are they always lower case? Also, how is that reference supposed to be modified to a URL? I.e. what would the URL look like for your example of '105.f'? Ok... 1. Yes each section is three digits. 2. No, at present they are not but I could add the period if that would be required 3. Yes, if there is a subsection then that subsection is numbered as [section number].[subsection letter] 4(?) Each separate data piece is in a bootstrap collapse with an ID of "sectionNNN.L" or "sectionNNN" as appropriate. So I will be wrapping the reference in <span class="btn btn-link" data-target="section???" onclick=" showPage('section???')" data-parent=" #page">???</span> Specifically the data is the comprehensive rules text at magic.wizards.com/rules
  9. Karaethon

    script to fade bg color on page

    Thank you for your help. I ended up with this (which is a lot like what I just noticed you posted) I was able to drop the shifts to grey that I thought I would need for good color blending but didn't need after testing. body { width: 100%; height: 100%; animation: pulse 60s infinite; overflow-y:auto; } @keyframes pulse { 0% { background-color: #ffffff; } 10%{ color: #ff0000; } 20%{ background-color: #0000ff; } 30%{ color: #00ff00; } 40%{ background-color: #000000; } 50%{ color: #ffffff; } 60%{ background-color: #ff0000; } 70%{ color: #0000ff; } 80%{ background-color: #00ff00; } 90%{ color: #000000; } 100% { background-color: #ffffff; } }
  10. Karaethon

    script to fade bg color on page

    Oh. I can do it in css? Everything I need to do? I saw how it was alternating between two colors but can I randomly alternative between grey and one of the 5 colors? Great site, but now my headache got worse....
  11. I am trying to set my include path in my .htaccess file but anything i put after the php_value include_path such as php_value include_path "../includes" causes a server error. Anyone know what I'm doing wrong, and can enlighten me?
  12. Karaethon

    Using php_value include_path in .htaccess

    How do I do that? Where is the setting at?
  13. Karaethon

    Using php_value include_path in .htaccess

    Ok, so my localhost isnt using it as a module? It works in my live (hosted) site, so i guess i cannot test that part then.
  14. Karaethon

    Using php_value include_path in .htaccess

    And i know you'll probably ask, the log says... httpd log: [Thu Feb 07 23:45:05 2019] [alert] [client 127.0.0.1] /storage/615F-8AC8/Android/data/com.twoseventwodev.icodego/files/external/Split Infinitive Software Website/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
  15. Karaethon

    Using php_value include_path in .htaccess

    Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.
  16. Karaethon

    Regex huh?

    Hmm, you're right. I tried it with my password and it did not match it, but as I understood it I thought it would. Ugh.
  17. Karaethon

    Regex huh?

    Ok, so I've been reading about regex and I think I get it. I have one question that I think will prove I do or shoot me in the gut... ^([A-Z]+ [a-z]+ [\?\,\.!@#\$]+)${8,50} means the entire string must include at least 1 capital letter, at least 1 lowercase letter, at least one symbol, and be between 8 and 50 characters (inclusive). Is this correct? And if i wanted min 8 max infinity I'd just use 8 dots ( ........ ) in place of the {8,50}, correct?
  18. Karaethon

    Regex huh?

    Ok... umm now I'm a little confused.... that site (rocks btw) says that my pattern will do exactly what I thought it would do.... (when i flip the $ and {8,50}) Edit Of course now I'm on past that, I'm trying to figure out how to use this password stuff on this site... https://nulab-inc.com/blog/nulab/password-strength/
  19. Karaethon

    Getting numeric value of data

    I can't find the answer to this on Google because i don't even know what to ask as search keywords. I have a chunk of data, uploaded file data, and for each byte I need to get that byte of it and find the numeric value (0 - 255) of that byte. I can't find anything about data or file manipulation with javascript, I think I'm asking big G the wrong way.
  20. Karaethon

    Getting numeric value of data

    Ahhhh. Okay. Havent tried casses in php yet either, good to know.
  21. Karaethon

    Regex huh?

    Ok. Hmmm. Well at least the space issue isnt there, i added those for readability when i put it here, but its good to know not to do in production. The rest ... arghhhhh ill re-read and try again..... 😓
  22. Karaethon

    Getting numeric value of data

    Ok, i accidentally fixed it.... I changed 03 var pivotTable = [162,1,53,...,93,91,16];04 var passKey = ""; to 03 this.pivotTable = [162,1,53,...,93,91,16];04 this.passKey = ""; if anyone knows why this worked, I'd appreciate the explanation.
  23. Karaethon

    Getting numeric value of data

    ok.... I'm having an odd problem here... This code fails at line 16 because pivotTable is undefined there (line 15 is test for content), but not at line 5. But passkey at line 14 is not a problem... 01 class PivotValueEncryption{ 02 constructor(){ 03 var pivotTable = [162,1,53,...,93,91,16]; 04 var passKey = ""; 05 alert(pivotTable); 06 } 07 set key(value){ 08 this.passKey = value; 09 } 10 get key(){ 11 return this.passKey; 12 } 13 Pivot(character){ 14 alert(this.passKey); 15 alert(this.pivotTable); 16 var charValue = this.pivotTable.indexOf(character.charCodeAt(0)); 17 for (var i = 0; i<this.passkey.length-1; i++){ 18 var pivotValue = this.pivotTable.indexOf(this.passkey.charCodeAt(i)); 19 charValue = charValue + (pivotValue - charValue); 20 21 } 22 return charValue 23 } 24 } 25 var pve = new PivotValueEncryption; 26 pve.key="test"; 27 alert(pve.key); 28 alert(pve.Pivot("A"))
  24. Karaethon

    Getting numeric value of data

    Ok. Thank you for your help.
  25. Karaethon

    Getting numeric value of data

    Ok, I have an array, table by name, it contains the numbers 0 through 255 (inclusive)in a random order. I am looping through the file data one byte at a time and i need the table's index of the numeric value that byte is equal to. So I need a way to get the numeric value of a byte so I can find it in table using .indexOf
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.