sort of an iterating function

  • Thread starter Bill Cunningham
  • Start date
B

Bill Cunningham

the function ?_bcrypt from the posix library has a parameter that
accepts in values of eights these variables are know as key and data and
they are both char *. I can think of course of a big iterating function that
can use for and use it to iterate values of eight but I would like to have a
simpler way. I know that this doesn't work

char key[2*8]="The is key to crypt by\n";

The function only accepts bytes in multiples of 8. This function can be
found at man cbc_crypt. For the length parameter I use sizeof data. What
about-

int i=8;
for (;i<sizeof data;i(i*2)++)

Of course I could always type my data and key and manually iterate. Can
something like this be done?

cbc_encrypt(work with multiples of 8's,...) ?


B
 
B

Bill Cunningham

Bill said:
the function ?_bcrypt from the posix library has a parameter that
accepts in values of eights these variables are know as key and data
and they are both char *. I can think of course of a big iterating
function that can use for and use it to iterate values of eight but I
would like to have a simpler way. I know that this doesn't work

char key[2*8]="The is key to crypt by\n";

The function only accepts bytes in multiples of 8. This function
can be found at man cbc_crypt. For the length parameter I use sizeof
data. What about-

int i=8;
for (;i<sizeof data;i(i*2)++)

Of course I could always type my data and key and manually
iterate. Can something like this be done?

cbc_encrypt(work with multiples of 8's,...) ?


B

I got it I'll work on something.

THNX
 
B

Barry Schwarz

Bill said:
the function ?_bcrypt from the posix library has a parameter that
accepts in values of eights these variables are know as key and data
and they are both char *. I can think of course of a big iterating
function that can use for and use it to iterate values of eight but I
would like to have a simpler way. I know that this doesn't work

char key[2*8]="The is key to crypt by\n";

The function only accepts bytes in multiples of 8. This function
can be found at man cbc_crypt. For the length parameter I use sizeof
data. What about-

int i=8;
for (;i<sizeof data;i(i*2)++)

Of course I could always type my data and key and manually
iterate. Can something like this be done?

cbc_encrypt(work with multiples of 8's,...) ?


B

I got it I'll work on something.

I don't know what you think you have but

Your first paragraph doesn't make any sense. You talk of a
single parameter and then multiple variables. I also don't know what
a "value of eight" means when referring to char*. What do you mean by
iterating function. Just for the record, key must be a string of
exactly eight bytes and data must be a string that is a multiple of 8
bytes.

Your array definition contains a constraint violation.

Your for loop contains at least one syntax error. You would be
better to use strlen(data) instead of sizeof(data) since data is
actually a pointer and sizeof will usually be 4 (or 8).

Since you have not yet said what you want to do, and I'm sure it
will change in the next message as you hop around from one random
subject to the another, we have no idea if it can be done or how to do
it.
 
B

Bill Cunningham

Barry said:
Bill said:
the function ?_bcrypt from the posix library has a parameter that
accepts in values of eights these variables are know as key and data
and they are both char *. I can think of course of a big iterating
function that can use for and use it to iterate values of eight but
I would like to have a simpler way. I know that this doesn't work

char key[2*8]="The is key to crypt by\n";

The function only accepts bytes in multiples of 8. This function
can be found at man cbc_crypt. For the length parameter I use sizeof
data. What about-

int i=8;
for (;i<sizeof data;i(i*2)++)

Of course I could always type my data and key and manually
iterate. Can something like this be done?

cbc_encrypt(work with multiples of 8's,...) ?


B

I got it I'll work on something.

I don't know what you think you have but

Your first paragraph doesn't make any sense. You talk of a
single parameter and then multiple variables. I also don't know what
a "value of eight" means when referring to char*. What do you mean by
iterating function. Just for the record, key must be a string of
exactly eight bytes and data must be a string that is a multiple of 8
bytes.

Your array definition contains a constraint violation.

Your for loop contains at least one syntax error.

One of the things right now that is giving me some wrestling fits in C
right now is flow control. Syntax, how to use and when to use switch, if,
for, while, and so on.

You would be
better to use strlen(data) instead of sizeof(data) since data is
actually a pointer and sizeof will usually be 4 (or 8).

What I meant by values of 8 was multiples of 8.

Bill
 
B

Bill Cunningham

[snipped much]

ok. Let me try to start at the beginning and make this as simple as
possible and try to make sense. The first two parameters to cbc_crypt are
char *. And therefore are 8 bytes in size each. Now this 3rd parameter
confuses me. It says multiples of 8 must exist. Parameter 1 and 2 should
each be 8 bytes. How does one make sure that strlen always reports an
unsigned type of a number that is a multiple of 8? Isn't this what this
function is wanting? Is a size_t just and unsigned int?

Bill
 
J

jacob navia

Le 03/05/12 02:13, Bill Cunningham a écrit :
the function ?_bcrypt from the posix library has a parameter that
accepts in values of eights these variables are know as key and data and
they are both char *.


Unable to write anything that makes any kind of sense.
the function ?_bcrypt from the posix library has a parameter that
accepts in values of eights

FIRST learn the grammar and, after writing, TURN ON YOUR BRAIN and
READ what you have written. "A PARAMETER THAT ACCEPTS IN VALUES OF
EIGHTS" makes no sense to anyone but you.

Then, you go on:
these variables are know as key and data and
they are both char *.

Why THESE variables if you have written in the previous sentence that
it "has A parameter"? Are you speaking about THE parameter (singular)
or about the "EIGHTS" (whatever those are)?

Then you continue:

"these variables are know as key and data"

"ARE KNOW" maybe "ARE KNOWN"?

I can think of course of a big iterating function that
can use for and use it to iterate values of eight

Delirium. "A big iterating function that can use for and
use it to iterate values of eight" is nonsense. There
is no meaning behind your sentence.

but I would like to have a
simpler way. I know that this doesn't work

Nothing works until you learn to write.
char key[2*8]="The is key to crypt by\n";

There is no need to encrypt your prose Cunningham. It is already
incomprehensible as it is.
The function only accepts bytes in multiples of 8. This function can be
found at man cbc_crypt. For the length parameter I use sizeof data. What
about-

int i=8;
for (;i<sizeof data;i(i*2)++)

Since you did not define what "data" is, nobody can know.

Of course I could always type my data and key and manually iterate. Can
something like this be done?

Sure. Just try it.
cbc_encrypt(work with multiples of 8's,...) ?

Your state of mind, as reflected by your prose, is utter confusion.
You imply in your posts that somehow your medication is responsible but
that is not the problem. The problem is that you assume that the other
people are responsible for your nonsense and that you do not have to
make the effort of RE-READING what you write 2 or 3 times to ensure
that the grammar is correct and that anyone can understand what you
write.

For instance you could have written "bcrypt" instead of ?_bcrypt
as you wrote. A simple re-reading would have fixed that. But you do
not make any effort at all to re-read what you write. Just post it.
The others should make the necessary effort.

That is a LAZY attitude that leads you to NOTHING. You have never made
ANY progress, either in C or in English, and before learning C you
should try to write a single post WITHOUT any error of grammar.

Make an effort Cunningham. Stop pitying yourself.

jacob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top