1 Replies - 1687 Views - Last Post: 07 July 2012 - 01:13 AM Rate Topic: -----

#1 BloodyInari  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 106
  • Joined: 16-November 09

Cryptography key strength/"break-ability"

Posted 07 July 2012 - 12:56 AM

So, as I was working on a method for extended FOIL operations via recursion, I noticed a numerical pattern that tended to arise which as a string grew in exponential length as the number of terms involved increased monotonically. This string, rather pattern, caught my interest after I finished developing said method and I began to play with it as an idea for a cryptographic-key generator. To ensure that the key was not explicitly understood, I converted each specific element of the sequence over to binary, reconfigured it back into a string and converted back to base_10 as a numerical value to be implemented. As a mathematician and a beginner programmer in this field of interest (crypto), I would like to hear you input in the utility, strength or lack thereof, or any interest in the little project I had been developing recently as well as input, provided it would be useful (or otherwise), on utilizing my method for encryption.

Some details, as said before, is that the length of the string grows exponential, which is just nearly as true as it does as a base_10 value; however, in base_10 format, I have been unable to predict the "exponential" rate of growth, so it appears to be a psuedo-random number than can be generated by an explicit function. And because it grows so fast, factorization of the key into its trivial parts quickly becomes more difficult and time consuming.

Let me know what you guys think. Code below is the functional program (currently set up for user input, but that can be subject to change as I might alter the function at a later time) as is and displays in the console/shell upon being imported.

#base 10 to base 2 converter
def DenaryToBinary(n):
    binStr = " "
    if n < 0:
        raise ValueError, "must be a positive integer"
    if n == 0:
        return eval("0")
    while n > 0:
        binStr = str(n%2) + binStr
        n = n >> 1
    return eval(binStr)
def main():
    #sets up while loop parameters
    n = input("How many iterations?: ")
    i = 0
    sum = 0.0
    #initial variables, iter = 0
    a = [0]
    arraySum = []
    initBinArray = []
    initializer = [0]
    outputArray = [0]
    storeArray = initializer
    storeArray[0] = initializer[0] + 1
    String = ""

    print "0th iteration\t", a, "\n"

    #while loop to nth iterations
    while i in range(n):

        #prior array incremented by one to new array
        for p in range(2**(i)):
            outputArray[p] += 1
        #prior array and adds to current array
        for q in range(2**(i)):
        #sums elements of array
        for r in range(len(outputArray)):
            sum += outputArray[r]
        #coverts elements of outputArray to binary; then coverts entire array contents to string
        for z in range(len(outputArray)):
            String += str(initBinArray[z])
        #output data
        print str(i+1)+"th iteration", "\t", outputArray
        print str(i+1)+"th iteration sum: ", sum
        print "Conversion value:", int(String,2), "\n"

        #reconfiguring critical variables
        i += 1
        initBinArray = []
        storeArray = outputArray
        String = ""
        sum = 0.0

    #ratio of sequential elements
    #for j in range(len(d)-1):
    #    ratio = d[j+1]/d[j]
    #    print j, "\t", ratio
    #limit(ratio, as j approaches infinity) = 2

Is This A Good Question/Topic? 0
  • +

Replies To: Cryptography key strength/"break-ability"

#2 BloodyInari  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 106
  • Joined: 16-November 09

Re: Cryptography key strength/"break-ability"

Posted 07 July 2012 - 01:13 AM

which if I run my input where n=10 (and ignoring two three lines of print statements), I output as so:










This post has been edited by BloodyInari: 07 July 2012 - 01:15 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1