PRBHA-10: A hashing algorithm in PythonHashing passwords for a websiteHow easy is it to crack this encryption...

What's the correct term describing the action of sending a brand-new ship out into its first seafaring trip?

What happens to foam insulation board after you pour concrete slab?

How can Iron Man's suit withstand this?

Etymology of 'calcit(r)are'?

Function to extract float from different price patterns

Do manufacturers try make their components as close to ideal ones as possible?

How would you say “AKA/as in”?

Can't login after removing Flatpak

Is it legal in the UK for politicians to lie to the public for political gain?

Through what methods and mechanisms can a multi-material FDM printer operate?

Aligning object in a commutative diagram

Whats the next step after commercial fusion reactors?

Can a magnetic field of an object be stronger than its gravity?

Pronoun introduced before its antecedent

Is there any word or phrase for negative bearing?

Does the first version of Linux developed by Linus Torvalds have a GUI?

Word for a small burst of laughter that can't be held back

What happened to all the nuclear material being smuggled after the fall of the USSR?

Traffic law UK, pedestrians

How to supress loops in a digraph?

In this example, which path would a monster affected by the Dissonant Whispers spell take?

How hard would it be to convert a glider into an powered electric aircraft?

Why did a party with more votes get fewer seats in the 2019 European Parliament election in Denmark?

Building a road to escape Earth's gravity by making a pyramid on Antartica



PRBHA-10: A hashing algorithm in Python


Hashing passwords for a websiteHow easy is it to crack this encryption algorithm?PHP password encryption algorithmMy images have secrets A.K.A. the making of aesthetic passwordsMy images have secrets A.K.A. the making of aesthetic passwords V.2Python image encryption security analysis






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2












$begingroup$


So I've been working on a simple little hashing algorithm for Python that I like to call PRBHA-10 for short, or Pseudo-Random-Based Hash Algorithm. This is a hash algorithm in Python that is meant to be simplistic and secure. As you could see from the title, the algorithm implements a system with seeding the pseudo-random number generator to be able to produce the correct integer values when provided the correct password, therefore enabling the decryption of an encrypted byte sequence or string.



Here's the advantages of my method:




  • The functions are tiny and simple, unlike some hashing methods out there.


  • Despite the simplicity of the algorithm, it is secure due to the generation of large random numbers that scale with the password size.


  • There is no chance of revealing even part of the encrypted string without the full password due to the huge numbers created by the seeded PRNG and multiplication that completely messes up the string if the wrong password is entered.


  • It is fast. I have not done timeits yet, but the functions run in a trivial amount of time to generate their results.



The disadvantages:




  • A somewhat large password is required to ensure security - usually anything over seven characters is completely cryptographically secure.


  • It is vulnerable to the same brute-force attacks that any cryptographic encryption method is vulnerable to.


  • With larger passwords comes greater security, but also a larger hash. The hash size slightly increases with each character added onto the password.



Here's the whole module program, prhba.py:



"""Pseudo-Random Based Hash Algorithm (PRHBA-10) is a simple 
Python cipher that uses the integer representation of a
string, along with taking advantage of the built-in
pseudo-random number generator to be able to securely encrypt
strings and bytearrays.

The algorithm uses the integer representation of byte sequences,
seeding the random number generator using the password to
create a predictable random number for later use, and a special
encoded form to turn any byte sequence into an ASCII string
using only the letters 'aceilnorst'. This is secure due to the
extremely large random number generated ensuring the security
of the result.

The result can be later decrypted using a special algorithm to
decipher the text into a large integer number. Then, the
password is used as a seed to once again get the random number
used earlier in the process. That integer is used to modify
the large integer to be able to get the integer form of the
original string, which can then be converted to a string.

This cipher currently only works in Python due to the specific
random number generation implementation in the `random` module.
"""

import math
import random

__all__ = ["encrypt", "decrypt"]

LETTERS = "aceilnorst"

def to_num(s):
return int.from_bytes(s.encode(), 'little')

def from_num(n):
return n.to_bytes(math.ceil(n.bit_length() / 8), 'little')

def encrypt(data, password):
assert len(password) > 1, "Password length cannot be less than two"
random.seed(to_num(password))
unique_id = to_num(data) * random.getrandbits(len(password))
chunk = []
for digit in str(unique_id):
chunk.append(LETTERS[int(digit)])
return "".join(chunk)

def decrypt(encrypted_data, password):
random.seed(to_num(password))
partnum_digits = []
for char in encrypted_data:
partnum_digits.append(str(LETTERS.index(char)))
partnum = int("".join(partnum_digits))
return from_num(partnum // random.getrandbits(len(password)))


Here's the questions I have:




  • Is it PEP-8 compliant?


  • Are the variable names confusing?


  • Is there any parts that could be improved or further reduced?


  • Do you have any other suggestions?



Thanks in advance!










share|improve this question









$endgroup$



















    2












    $begingroup$


    So I've been working on a simple little hashing algorithm for Python that I like to call PRBHA-10 for short, or Pseudo-Random-Based Hash Algorithm. This is a hash algorithm in Python that is meant to be simplistic and secure. As you could see from the title, the algorithm implements a system with seeding the pseudo-random number generator to be able to produce the correct integer values when provided the correct password, therefore enabling the decryption of an encrypted byte sequence or string.



    Here's the advantages of my method:




    • The functions are tiny and simple, unlike some hashing methods out there.


    • Despite the simplicity of the algorithm, it is secure due to the generation of large random numbers that scale with the password size.


    • There is no chance of revealing even part of the encrypted string without the full password due to the huge numbers created by the seeded PRNG and multiplication that completely messes up the string if the wrong password is entered.


    • It is fast. I have not done timeits yet, but the functions run in a trivial amount of time to generate their results.



    The disadvantages:




    • A somewhat large password is required to ensure security - usually anything over seven characters is completely cryptographically secure.


    • It is vulnerable to the same brute-force attacks that any cryptographic encryption method is vulnerable to.


    • With larger passwords comes greater security, but also a larger hash. The hash size slightly increases with each character added onto the password.



    Here's the whole module program, prhba.py:



    """Pseudo-Random Based Hash Algorithm (PRHBA-10) is a simple 
    Python cipher that uses the integer representation of a
    string, along with taking advantage of the built-in
    pseudo-random number generator to be able to securely encrypt
    strings and bytearrays.

    The algorithm uses the integer representation of byte sequences,
    seeding the random number generator using the password to
    create a predictable random number for later use, and a special
    encoded form to turn any byte sequence into an ASCII string
    using only the letters 'aceilnorst'. This is secure due to the
    extremely large random number generated ensuring the security
    of the result.

    The result can be later decrypted using a special algorithm to
    decipher the text into a large integer number. Then, the
    password is used as a seed to once again get the random number
    used earlier in the process. That integer is used to modify
    the large integer to be able to get the integer form of the
    original string, which can then be converted to a string.

    This cipher currently only works in Python due to the specific
    random number generation implementation in the `random` module.
    """

    import math
    import random

    __all__ = ["encrypt", "decrypt"]

    LETTERS = "aceilnorst"

    def to_num(s):
    return int.from_bytes(s.encode(), 'little')

    def from_num(n):
    return n.to_bytes(math.ceil(n.bit_length() / 8), 'little')

    def encrypt(data, password):
    assert len(password) > 1, "Password length cannot be less than two"
    random.seed(to_num(password))
    unique_id = to_num(data) * random.getrandbits(len(password))
    chunk = []
    for digit in str(unique_id):
    chunk.append(LETTERS[int(digit)])
    return "".join(chunk)

    def decrypt(encrypted_data, password):
    random.seed(to_num(password))
    partnum_digits = []
    for char in encrypted_data:
    partnum_digits.append(str(LETTERS.index(char)))
    partnum = int("".join(partnum_digits))
    return from_num(partnum // random.getrandbits(len(password)))


    Here's the questions I have:




    • Is it PEP-8 compliant?


    • Are the variable names confusing?


    • Is there any parts that could be improved or further reduced?


    • Do you have any other suggestions?



    Thanks in advance!










    share|improve this question









    $endgroup$















      2












      2








      2





      $begingroup$


      So I've been working on a simple little hashing algorithm for Python that I like to call PRBHA-10 for short, or Pseudo-Random-Based Hash Algorithm. This is a hash algorithm in Python that is meant to be simplistic and secure. As you could see from the title, the algorithm implements a system with seeding the pseudo-random number generator to be able to produce the correct integer values when provided the correct password, therefore enabling the decryption of an encrypted byte sequence or string.



      Here's the advantages of my method:




      • The functions are tiny and simple, unlike some hashing methods out there.


      • Despite the simplicity of the algorithm, it is secure due to the generation of large random numbers that scale with the password size.


      • There is no chance of revealing even part of the encrypted string without the full password due to the huge numbers created by the seeded PRNG and multiplication that completely messes up the string if the wrong password is entered.


      • It is fast. I have not done timeits yet, but the functions run in a trivial amount of time to generate their results.



      The disadvantages:




      • A somewhat large password is required to ensure security - usually anything over seven characters is completely cryptographically secure.


      • It is vulnerable to the same brute-force attacks that any cryptographic encryption method is vulnerable to.


      • With larger passwords comes greater security, but also a larger hash. The hash size slightly increases with each character added onto the password.



      Here's the whole module program, prhba.py:



      """Pseudo-Random Based Hash Algorithm (PRHBA-10) is a simple 
      Python cipher that uses the integer representation of a
      string, along with taking advantage of the built-in
      pseudo-random number generator to be able to securely encrypt
      strings and bytearrays.

      The algorithm uses the integer representation of byte sequences,
      seeding the random number generator using the password to
      create a predictable random number for later use, and a special
      encoded form to turn any byte sequence into an ASCII string
      using only the letters 'aceilnorst'. This is secure due to the
      extremely large random number generated ensuring the security
      of the result.

      The result can be later decrypted using a special algorithm to
      decipher the text into a large integer number. Then, the
      password is used as a seed to once again get the random number
      used earlier in the process. That integer is used to modify
      the large integer to be able to get the integer form of the
      original string, which can then be converted to a string.

      This cipher currently only works in Python due to the specific
      random number generation implementation in the `random` module.
      """

      import math
      import random

      __all__ = ["encrypt", "decrypt"]

      LETTERS = "aceilnorst"

      def to_num(s):
      return int.from_bytes(s.encode(), 'little')

      def from_num(n):
      return n.to_bytes(math.ceil(n.bit_length() / 8), 'little')

      def encrypt(data, password):
      assert len(password) > 1, "Password length cannot be less than two"
      random.seed(to_num(password))
      unique_id = to_num(data) * random.getrandbits(len(password))
      chunk = []
      for digit in str(unique_id):
      chunk.append(LETTERS[int(digit)])
      return "".join(chunk)

      def decrypt(encrypted_data, password):
      random.seed(to_num(password))
      partnum_digits = []
      for char in encrypted_data:
      partnum_digits.append(str(LETTERS.index(char)))
      partnum = int("".join(partnum_digits))
      return from_num(partnum // random.getrandbits(len(password)))


      Here's the questions I have:




      • Is it PEP-8 compliant?


      • Are the variable names confusing?


      • Is there any parts that could be improved or further reduced?


      • Do you have any other suggestions?



      Thanks in advance!










      share|improve this question









      $endgroup$




      So I've been working on a simple little hashing algorithm for Python that I like to call PRBHA-10 for short, or Pseudo-Random-Based Hash Algorithm. This is a hash algorithm in Python that is meant to be simplistic and secure. As you could see from the title, the algorithm implements a system with seeding the pseudo-random number generator to be able to produce the correct integer values when provided the correct password, therefore enabling the decryption of an encrypted byte sequence or string.



      Here's the advantages of my method:




      • The functions are tiny and simple, unlike some hashing methods out there.


      • Despite the simplicity of the algorithm, it is secure due to the generation of large random numbers that scale with the password size.


      • There is no chance of revealing even part of the encrypted string without the full password due to the huge numbers created by the seeded PRNG and multiplication that completely messes up the string if the wrong password is entered.


      • It is fast. I have not done timeits yet, but the functions run in a trivial amount of time to generate their results.



      The disadvantages:




      • A somewhat large password is required to ensure security - usually anything over seven characters is completely cryptographically secure.


      • It is vulnerable to the same brute-force attacks that any cryptographic encryption method is vulnerable to.


      • With larger passwords comes greater security, but also a larger hash. The hash size slightly increases with each character added onto the password.



      Here's the whole module program, prhba.py:



      """Pseudo-Random Based Hash Algorithm (PRHBA-10) is a simple 
      Python cipher that uses the integer representation of a
      string, along with taking advantage of the built-in
      pseudo-random number generator to be able to securely encrypt
      strings and bytearrays.

      The algorithm uses the integer representation of byte sequences,
      seeding the random number generator using the password to
      create a predictable random number for later use, and a special
      encoded form to turn any byte sequence into an ASCII string
      using only the letters 'aceilnorst'. This is secure due to the
      extremely large random number generated ensuring the security
      of the result.

      The result can be later decrypted using a special algorithm to
      decipher the text into a large integer number. Then, the
      password is used as a seed to once again get the random number
      used earlier in the process. That integer is used to modify
      the large integer to be able to get the integer form of the
      original string, which can then be converted to a string.

      This cipher currently only works in Python due to the specific
      random number generation implementation in the `random` module.
      """

      import math
      import random

      __all__ = ["encrypt", "decrypt"]

      LETTERS = "aceilnorst"

      def to_num(s):
      return int.from_bytes(s.encode(), 'little')

      def from_num(n):
      return n.to_bytes(math.ceil(n.bit_length() / 8), 'little')

      def encrypt(data, password):
      assert len(password) > 1, "Password length cannot be less than two"
      random.seed(to_num(password))
      unique_id = to_num(data) * random.getrandbits(len(password))
      chunk = []
      for digit in str(unique_id):
      chunk.append(LETTERS[int(digit)])
      return "".join(chunk)

      def decrypt(encrypted_data, password):
      random.seed(to_num(password))
      partnum_digits = []
      for char in encrypted_data:
      partnum_digits.append(str(LETTERS.index(char)))
      partnum = int("".join(partnum_digits))
      return from_num(partnum // random.getrandbits(len(password)))


      Here's the questions I have:




      • Is it PEP-8 compliant?


      • Are the variable names confusing?


      • Is there any parts that could be improved or further reduced?


      • Do you have any other suggestions?



      Thanks in advance!







      python python-3.x random cryptography






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 11 hours ago









      connectyourchargerconnectyourcharger

      1938




      1938






















          1 Answer
          1






          active

          oldest

          votes


















          4












          $begingroup$

          Don’t roll your own encryption. It takes a team of experts to develop new secure encryption methods, and even they can get it wrong from time to time.



          Huge hole in your DIY encryption:



          If I use a 2-character password, I might naïvely expect I’d have $62^2$ possible passwords that I can encrypt the data with. I’d be really shocked when it turns out there are only 4.



          random.getrandbits(len(password))


          generates 2 random bits, for $2^2$ possible values to multiply to_num(data) by. Only 4 possibilities is a lot easier to attack than $62^2$ different possibilities!



          And one of those possibilities ... all bits zero ... destroys all the data you want to encode. So we’re down to actually only 3 possible numbers to test to reverse the encryption.





          Any encryption mechanism worth its salt uses a salt (initial random data) to prevent the same message with the same password from being encrypted as the same text.





          Code improvements: use generator expressions. Eg)



          chunk = []
          for digit in str(unique_id):
          chunk.append(LETTERS[int(digit)])
          return "".join(chunk)


          would be more efficient rewritten as:



          return "".join(LETTERS[int(digit)] for digit in str(unique_id))


          The chunk list is never created in memory; instead, the join method pulls items one at a time from the generator expression.





          Finally, don’t roll your own encryption.






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thanks for the suggestion. I agree, it is lacking in the department of small passwords. That's why I said it needs sufficiently large passwords in the post. This was just something I was playing with - I don't actually expect it to compete with any standard cryptographic methods.
            $endgroup$
            – connectyourcharger
            9 hours ago










          • $begingroup$
            You missed the point. A two character pass phrase creates a two bit encryption key; an 10 character pass phrase creates a 10 bit encryption key!!!
            $endgroup$
            – AJNeufeld
            8 hours ago










          • $begingroup$
            No, yes, I understand that. It's a limitation I've been trying to get past.
            $endgroup$
            – connectyourcharger
            8 hours ago












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "196"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f221499%2fprbha-10-a-hashing-algorithm-in-python%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4












          $begingroup$

          Don’t roll your own encryption. It takes a team of experts to develop new secure encryption methods, and even they can get it wrong from time to time.



          Huge hole in your DIY encryption:



          If I use a 2-character password, I might naïvely expect I’d have $62^2$ possible passwords that I can encrypt the data with. I’d be really shocked when it turns out there are only 4.



          random.getrandbits(len(password))


          generates 2 random bits, for $2^2$ possible values to multiply to_num(data) by. Only 4 possibilities is a lot easier to attack than $62^2$ different possibilities!



          And one of those possibilities ... all bits zero ... destroys all the data you want to encode. So we’re down to actually only 3 possible numbers to test to reverse the encryption.





          Any encryption mechanism worth its salt uses a salt (initial random data) to prevent the same message with the same password from being encrypted as the same text.





          Code improvements: use generator expressions. Eg)



          chunk = []
          for digit in str(unique_id):
          chunk.append(LETTERS[int(digit)])
          return "".join(chunk)


          would be more efficient rewritten as:



          return "".join(LETTERS[int(digit)] for digit in str(unique_id))


          The chunk list is never created in memory; instead, the join method pulls items one at a time from the generator expression.





          Finally, don’t roll your own encryption.






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thanks for the suggestion. I agree, it is lacking in the department of small passwords. That's why I said it needs sufficiently large passwords in the post. This was just something I was playing with - I don't actually expect it to compete with any standard cryptographic methods.
            $endgroup$
            – connectyourcharger
            9 hours ago










          • $begingroup$
            You missed the point. A two character pass phrase creates a two bit encryption key; an 10 character pass phrase creates a 10 bit encryption key!!!
            $endgroup$
            – AJNeufeld
            8 hours ago










          • $begingroup$
            No, yes, I understand that. It's a limitation I've been trying to get past.
            $endgroup$
            – connectyourcharger
            8 hours ago
















          4












          $begingroup$

          Don’t roll your own encryption. It takes a team of experts to develop new secure encryption methods, and even they can get it wrong from time to time.



          Huge hole in your DIY encryption:



          If I use a 2-character password, I might naïvely expect I’d have $62^2$ possible passwords that I can encrypt the data with. I’d be really shocked when it turns out there are only 4.



          random.getrandbits(len(password))


          generates 2 random bits, for $2^2$ possible values to multiply to_num(data) by. Only 4 possibilities is a lot easier to attack than $62^2$ different possibilities!



          And one of those possibilities ... all bits zero ... destroys all the data you want to encode. So we’re down to actually only 3 possible numbers to test to reverse the encryption.





          Any encryption mechanism worth its salt uses a salt (initial random data) to prevent the same message with the same password from being encrypted as the same text.





          Code improvements: use generator expressions. Eg)



          chunk = []
          for digit in str(unique_id):
          chunk.append(LETTERS[int(digit)])
          return "".join(chunk)


          would be more efficient rewritten as:



          return "".join(LETTERS[int(digit)] for digit in str(unique_id))


          The chunk list is never created in memory; instead, the join method pulls items one at a time from the generator expression.





          Finally, don’t roll your own encryption.






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thanks for the suggestion. I agree, it is lacking in the department of small passwords. That's why I said it needs sufficiently large passwords in the post. This was just something I was playing with - I don't actually expect it to compete with any standard cryptographic methods.
            $endgroup$
            – connectyourcharger
            9 hours ago










          • $begingroup$
            You missed the point. A two character pass phrase creates a two bit encryption key; an 10 character pass phrase creates a 10 bit encryption key!!!
            $endgroup$
            – AJNeufeld
            8 hours ago










          • $begingroup$
            No, yes, I understand that. It's a limitation I've been trying to get past.
            $endgroup$
            – connectyourcharger
            8 hours ago














          4












          4








          4





          $begingroup$

          Don’t roll your own encryption. It takes a team of experts to develop new secure encryption methods, and even they can get it wrong from time to time.



          Huge hole in your DIY encryption:



          If I use a 2-character password, I might naïvely expect I’d have $62^2$ possible passwords that I can encrypt the data with. I’d be really shocked when it turns out there are only 4.



          random.getrandbits(len(password))


          generates 2 random bits, for $2^2$ possible values to multiply to_num(data) by. Only 4 possibilities is a lot easier to attack than $62^2$ different possibilities!



          And one of those possibilities ... all bits zero ... destroys all the data you want to encode. So we’re down to actually only 3 possible numbers to test to reverse the encryption.





          Any encryption mechanism worth its salt uses a salt (initial random data) to prevent the same message with the same password from being encrypted as the same text.





          Code improvements: use generator expressions. Eg)



          chunk = []
          for digit in str(unique_id):
          chunk.append(LETTERS[int(digit)])
          return "".join(chunk)


          would be more efficient rewritten as:



          return "".join(LETTERS[int(digit)] for digit in str(unique_id))


          The chunk list is never created in memory; instead, the join method pulls items one at a time from the generator expression.





          Finally, don’t roll your own encryption.






          share|improve this answer









          $endgroup$



          Don’t roll your own encryption. It takes a team of experts to develop new secure encryption methods, and even they can get it wrong from time to time.



          Huge hole in your DIY encryption:



          If I use a 2-character password, I might naïvely expect I’d have $62^2$ possible passwords that I can encrypt the data with. I’d be really shocked when it turns out there are only 4.



          random.getrandbits(len(password))


          generates 2 random bits, for $2^2$ possible values to multiply to_num(data) by. Only 4 possibilities is a lot easier to attack than $62^2$ different possibilities!



          And one of those possibilities ... all bits zero ... destroys all the data you want to encode. So we’re down to actually only 3 possible numbers to test to reverse the encryption.





          Any encryption mechanism worth its salt uses a salt (initial random data) to prevent the same message with the same password from being encrypted as the same text.





          Code improvements: use generator expressions. Eg)



          chunk = []
          for digit in str(unique_id):
          chunk.append(LETTERS[int(digit)])
          return "".join(chunk)


          would be more efficient rewritten as:



          return "".join(LETTERS[int(digit)] for digit in str(unique_id))


          The chunk list is never created in memory; instead, the join method pulls items one at a time from the generator expression.





          Finally, don’t roll your own encryption.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 9 hours ago









          AJNeufeldAJNeufeld

          7,8971725




          7,8971725












          • $begingroup$
            Thanks for the suggestion. I agree, it is lacking in the department of small passwords. That's why I said it needs sufficiently large passwords in the post. This was just something I was playing with - I don't actually expect it to compete with any standard cryptographic methods.
            $endgroup$
            – connectyourcharger
            9 hours ago










          • $begingroup$
            You missed the point. A two character pass phrase creates a two bit encryption key; an 10 character pass phrase creates a 10 bit encryption key!!!
            $endgroup$
            – AJNeufeld
            8 hours ago










          • $begingroup$
            No, yes, I understand that. It's a limitation I've been trying to get past.
            $endgroup$
            – connectyourcharger
            8 hours ago


















          • $begingroup$
            Thanks for the suggestion. I agree, it is lacking in the department of small passwords. That's why I said it needs sufficiently large passwords in the post. This was just something I was playing with - I don't actually expect it to compete with any standard cryptographic methods.
            $endgroup$
            – connectyourcharger
            9 hours ago










          • $begingroup$
            You missed the point. A two character pass phrase creates a two bit encryption key; an 10 character pass phrase creates a 10 bit encryption key!!!
            $endgroup$
            – AJNeufeld
            8 hours ago










          • $begingroup$
            No, yes, I understand that. It's a limitation I've been trying to get past.
            $endgroup$
            – connectyourcharger
            8 hours ago
















          $begingroup$
          Thanks for the suggestion. I agree, it is lacking in the department of small passwords. That's why I said it needs sufficiently large passwords in the post. This was just something I was playing with - I don't actually expect it to compete with any standard cryptographic methods.
          $endgroup$
          – connectyourcharger
          9 hours ago




          $begingroup$
          Thanks for the suggestion. I agree, it is lacking in the department of small passwords. That's why I said it needs sufficiently large passwords in the post. This was just something I was playing with - I don't actually expect it to compete with any standard cryptographic methods.
          $endgroup$
          – connectyourcharger
          9 hours ago












          $begingroup$
          You missed the point. A two character pass phrase creates a two bit encryption key; an 10 character pass phrase creates a 10 bit encryption key!!!
          $endgroup$
          – AJNeufeld
          8 hours ago




          $begingroup$
          You missed the point. A two character pass phrase creates a two bit encryption key; an 10 character pass phrase creates a 10 bit encryption key!!!
          $endgroup$
          – AJNeufeld
          8 hours ago












          $begingroup$
          No, yes, I understand that. It's a limitation I've been trying to get past.
          $endgroup$
          – connectyourcharger
          8 hours ago




          $begingroup$
          No, yes, I understand that. It's a limitation I've been trying to get past.
          $endgroup$
          – connectyourcharger
          8 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Code Review Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f221499%2fprbha-10-a-hashing-algorithm-in-python%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...