XU XUv0.16.0

#crypto/rc4

import: #crypto/rc4

counts: 1 functions, 1 methods, 1 types, 0 constants, 0 method sets

RC4 stream cipher. Broken; kept for protocol interop only.

struct Cipher

XuAPI
pub struct Cipher {
    pub s []int
    pub i int
    pub j int
}

Purpose

Rc4 Cipher context for block or stream encryption/decryption.

Public fields

s []int
source string
i int
index or integer
j int
index

new_cipher

XuAPI
pub fn new_cipher(key &string) Cipher

Purpose

Construct cipher. Throws on failure; handle the error or propagate it to the caller.

Parameters

key &string
key (read-only borrow; caller keeps the original; type &string)

Returns

Cipher — a value of this type

($&Cipher) xor_key_stream

XuAPI
pub fn (c $&Cipher) xor_key_stream(src &string) string

Purpose

Operation on $&Cipher: xor key stream.

Parameters

c $&Cipher
The Cipher instance used by this call (exclusive borrow).
src &string
source (read-only borrow; caller keeps the original; type &string)

Returns

string — result string