crypto.rc4 #
Copyright (c) 2019-2024 Alexander Medvednikov. All rights reserved. Use of this source code is governed by an MIT license that can be found in the LICENSE file. Package rc4 implements RC4 encryption, as defined in Bruce Schneier's Applied Cryptography.
RC4 is cryptographically broken and should not be used for secure applications. Based off: https://github.com/golang/go/blob/master/src/crypto/rc4 Last commit: https://github.com/golang/go/commit/b35dacaac57b039205d9b07ea24098e2c3fcb12e
fn new_cipher #
fn new_cipher(key []u8) !&Cipher
new_cipher creates and returns a new Cipher. The key argument should be the RC4 key, at least 1 byte and at most 256 bytes.
fn (Cipher) free #
fn (mut c Cipher) free()
free the resources taken by the Cipher c
fn (Cipher) reset #
fn (mut c Cipher) reset()
reset zeros the key data and makes the Cipher unusable.good to com
Deprecated: Reset can't guarantee that the key will be entirely removed from the process's memory.
fn (Cipher) xor_key_stream #
fn (mut c Cipher) xor_key_stream(mut dst []u8, src []u8)
xor_key_stream sets dst to the result of XORing src with the key stream. Dst and src must overlap entirely or not at all.