Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Bitwise crashing unity?

$
0
0
So im working on a super rudamentary "encryption" system if you can even call it that lol. via utf8 encoding, and the bitwise operator '^' aka XOR. XOR is the only operator i've found that won't produce results outside of the ascii bounds (however i havn't been able to fully test this yet..... heres my code thus far var bytesToEncode : byte[] = Encoding.UTF8.GetBytes("Hello World!"); var key = "Key"; var keyBytes : byte[] = Encoding.UTF8.GetBytes(key); for(var i:int = 0; i < bytesToEncode.Length; i++){ bytesToEncode[i] = (byte)(bytesToEncode[i]^ keyBytes[keyBytes.Length %i]); } the problem is, line where the xor opperator is actually used produces an exception stating that (byte) doesn't have a visible constructor that matches the argumentlist (int). whats worse is when i remove (byte) unity completely crashes (near instantly). in the log file it said that the KERNALBASE.dll cause an access violation. not sure what any of that means but im sadly at a loss here. the point of this rudamentary encryption system is to have a password based encryption system that has no .net dependancies.

Viewing all articles
Browse latest Browse all 2383

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>