ASCII
ASCII is a 7-bit encoding standard which allows the representation of text using the integers 0-127.
Challenge:Using the below integer array, convert the numbers to their corresponding ASCII characters to obtain a flag.
[99, 114, 121, 112, 116, 111, 123, 65, 83, 67, 73, 73, 95, 112, 114, 49, 110, 116, 52, 98, 108, 51, 125]Solution (python) :To solve the above challenge I used the chr() function to convert each ASCII value into character.
Code python
ary = [99, 114, 121, 112, 116, 111, 123, 65, 83, 67, 73, 73, 95, 112, 114, 49, 110, 116, 52, 98, 108, 51, 125]
for a in ary:
print(chr(a),end="") # crypto{ASCII_pr1nt4bl3}
After running the above python code the output flag is : crypto{ASCII_pr1nt4bl3}
Solution (rust) :
Code rust
fn main() {
let asci = vec![99, 114, 121, 112, 116, 111, 123, 65, 83, 67, 73, 73, 95, 112, 114, 49, 110, 116, 52, 98, 108, 51, 125,];
let mut result: String = String::from("");
for i in asci {
match char::from_u32(i as u32) {
Some(a) => result.push(a),
None => todo!(),
}
}
println!("{}", result); // crypto{ASCII_pr1nt4bl3}
}