softsolvers
asked on
binary array shifting
hi everybody,
i am using encryption and decryptionin with RSA and symmectric algo aes in which
i have to shift byte to right and i m using that code in VB.Net
dim keyex(machine.shift.right( rsa.keysiz e,3) as byte
byte[] keyex(rsa.ketsize >> 3) as byte in c#
and i m getting error at word machine which is machine is not declared .
so i want to know that is there any class for machine.shift.right or how can i use machine class in vb.net
or is there any another way of doing which is this line machine.shift.right is doing
plz solve my problem
i would be very thankful to you
i am using encryption and decryptionin with RSA and symmectric algo aes in which
i have to shift byte to right and i m using that code in VB.Net
dim keyex(machine.shift.right(
byte[] keyex(rsa.ketsize >> 3) as byte in c#
and i m getting error at word machine which is machine is not declared .
so i want to know that is there any class for machine.shift.right or how can i use machine class in vb.net
or is there any another way of doing which is this line machine.shift.right is doing
plz solve my problem
i would be very thankful to you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sir,
i would like to thank you a lot for taking intrest in my problem.
the first solution which you have provided i:e to use "rsa.keysize >> 3" so i tried
Dim keyex(rsa.KeySize >> 3) As Byte
although this is not giving any compilation error but it gives a runtime error saying
ERROR : offset and lenght were out of bounds for the array or count is greater than number of elements from index to end of the source collection
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- -------
now sir i am trying your second solution that is with namespace.
so give me just few minutes so i'll get back to you
softsolvers
i would like to thank you a lot for taking intrest in my problem.
the first solution which you have provided i:e to use "rsa.keysize >> 3" so i tried
Dim keyex(rsa.KeySize >> 3) As Byte
although this is not giving any compilation error but it gives a runtime error saying
ERROR : offset and lenght were out of bounds for the array or count is greater than number of elements from index to end of the source collection
--------------------------
now sir i am trying your second solution that is with namespace.
so give me just few minutes so i'll get back to you
softsolvers
ASKER
can u please tell me which classes i need to import for your namespace. cos it is giving errors on doil function
sorry about that
Imports System.Reflection.Emit
Imports System.Reflection
Imports System.Reflection.Emit
Imports System.Reflection
if rsa.keysize is an unsigned integer than you are out of luck because vb.net doesn't support them (they will in the 2005 version though http://lab.msdn.microsoft.com/vs2005/.)
if rsa.keysize isn't an unsigned integer then you can just do
rsa.keysize >> 3