Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #42877 |

    Dear sir/madam I am a registered xceed foudation suite developer through componentsource. I was wondering if you could possibly help me solve a technical query. I am putting together an rsa software package and am having difficulties getting a sensible looking public and private key. When I generate the keys, and write them to text boxes, a number of question marks appear. Then, I was reading on your website that the keys were not strings. So, I then employed binary encoding library and did the conversion as near as possible to that of the example given. Everytime the app is run and the keys are generated, I now get a message “the filename in the header is empty”. When I debug, in VB6, it points to the actuaql key conversion done by the binary encoding library. If you could possibly solve this for me, I would be most grateful. I already sent this to your support dept under my real name of

    Imported from legacy forums. Posted by chewiejm (had 3690 views)

    User (Old forums)
    Post count: 23064

    We keep our keys in text files and use the following functions to convert them back and forth from binary: (hope it helps)

    ‘ Convert the variant specified to an hexadecimal representation, only if
    ‘ the variant is an array.
    Private Function BinaryToHex(ByRef vaBinaryValue As Variant) As String

    Dim i As Long
    Dim sNewValue As String

    sNewValue = “”

    If (VarType(vaBinaryValue) And vbArray) = vbArray Then
    For i = 0 To LenB(vaBinaryValue) – 1
    sNewValue = sNewValue & right(“0” & Hex(CLng(vaBinaryValue(i))), 2)
    Next i
    End If

    BinaryToHex = sNewValue

    End Function

    ‘ Convert the hexadecimal string to a byte array return as a variant
    Private Function HexToBinary(ByRef sHexValue As String) As Variant

    Dim i As Long
    Dim newvalue() As Byte

    i = 0
    While i < Len(sHexValue)
    ReDim Preserve newvalue(i / 2)
    newvalue(i / 2) = Val(“&H” & Mid$(sHexValue, i + 1, 2))
    i = i + 2

    HexToBinary = newvalue

    End Function

    Imported from legacy forums. Posted by thefritz_j (had 3479 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.