encrypt file without aligned

David J. Craig,

i have found your mail as follow:

Let me try a diagram:

[Data nnnnnnnn bytes mod 16] [15 bytes of data]

  1. Encrypt the Data nnnnnnnn bytes mod 16 first.
  2. Take one byte from the end of the data encrypted in 1. and add to the
    front of the 15 byte remainder.
  3. Encrypt that 16 byte packet.
  4. Write it to the file overlaying the one byte you took out.
  5. Do the decryption in reverse order doing the last 16 bytes first and
    then the mod 16 pieces of the file.

In my opinion,you means that the last block which is not aligned should be
encryptd with aligned by the block before last block,when encrype is over ,
the cipher of the last block overlaying the cipher of the block before last
block whitch is use to make the last block aligned,

e.g.
algorithm: alignd to 8,
buffer: 1234567890123
first block: 12345678
second block: 90123

when encrypt:
first block is aligned to 8,so no more process require just encrypt.
but the second(last) block is not aligned to 8,so use first
block(the block before last block)add to last block aligned to 8,
when encrypt second(last) block the block is became 67890123, so encrypt it.

join the two blocks cipher:

block 1 block 2

buffer: 12345678 67890123
cipher: XNBJE*** ***NJUEA

join the cipher,
cipher part 1: XNBJE***
cipher part 2: ***NJUEA

result: XNBJE***NJUEA

my algorithm is block related,that means the cipher of buffer 678 in first block is
not the same in second (last) block ,what can i do???

and if the algorithm is not 1:1,e.g 1:1.1 or even 1:2 ,how to deal with the file size???

thank you,

ildee

I think you need to hire a contractor to do your encryption logic. Try RSA
or Counterpane. Your understanding of the simple logic in this is
incorrect. The file size is not changed. There may be some number of bytes
(cipher block size - 1 or less) that are encrypted twice.

“ildee263” wrote in message news:xxxxx@ntfsd…
> David J. Craig,
>
> i have found your mail as follow:
> ------------------------------------------------------------------------------------------
>
> Let me try a diagram:
>
> [Data nnnnnnnn bytes mod 16] [15 bytes of data]
>
> 1. Encrypt the Data nnnnnnnn bytes mod 16 first.
> 2. Take one byte from the end of the data encrypted in 1. and add to the
> front of the 15 byte remainder.
> 3. Encrypt that 16 byte packet.
> 4. Write it to the file overlaying the one byte you took out.
> 5. Do the decryption in reverse order doing the last 16 bytes first and
> then the mod 16 pieces of the file.
>
> ------------------------------------------------------------------------------------------
>
> In my opinion,you means that the last block which is not aligned should be
> encryptd with aligned by the block before last block,when encrype is over
> ,
> the cipher of the last block overlaying the cipher of the block before
> last
> block whitch is use to make the last block aligned,
>
> e.g.
> algorithm: alignd to 8,
> buffer: 1234567890123
> first block: 12345678
> second block: 90123
>
>
> when encrypt:
> first block is aligned to 8,so no more process require just encrypt.
> but the second(last) block is not aligned to 8,so use first
> block(the block before last block)add to last block aligned to 8,
> when encrypt second(last) block the block is became 67890123, so encrypt
> it.
>
> join the two blocks cipher:
>
> block 1 block 2
>
> buffer: 12345678 67890123
> cipher: XNBJE ****** NJUEA
>
> join the cipher,
> cipher part 1: XNBJE
> cipher part 2:
NJUEA
>
> result: XNBJE***NJUEA
>
> my algorithm is block related,that means the cipher of buffer 678 in first
> block is
> not the same in second (last) block ,what can i do???
>
> and if the algorithm is not 1:1,e.g 1:1.1 or even 1:2 ,how to deal with
> the file size???
>
> thank you,
>
> ildee
>
>
>
>
>

oh,i see
you means this,

buffer : 1234567890123

when encrypt

first:

12345678
********

second:

***90123
########

cipher is :*****########

when decrypt:

first:
########
***90123

second:
********
12345678

buffer: 1234567890123

right???

haha , i get it!!thank you!!

ildee

----- Original Message -----
From: “David J. Craig”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Thursday, November 04, 2004 12:37 AM
Subject: Re:[ntfsd] encrypt file without aligned

> I think you need to hire a contractor to do your encryption logic. Try RSA
> or Counterpane. Your understanding of the simple logic in this is
> incorrect. The file size is not changed. There may be some number of bytes
> (cipher block size - 1 or less) that are encrypted twice.
>
> “ildee263” wrote in message news:xxxxx@ntfsd…
> > David J. Craig,
> >
> > i have found your mail as follow:
> > ------------------------------------------------------------------------------------------
> >
> > Let me try a diagram:
> >
> > [Data nnnnnnnn bytes mod 16] [15 bytes of data]
> >
> > 1. Encrypt the Data nnnnnnnn bytes mod 16 first.
> > 2. Take one byte from the end of the data encrypted in 1. and add to the
> > front of the 15 byte remainder.
> > 3. Encrypt that 16 byte packet.
> > 4. Write it to the file overlaying the one byte you took out.
> > 5. Do the decryption in reverse order doing the last 16 bytes first and
> > then the mod 16 pieces of the file.
> >
> > ------------------------------------------------------------------------------------------
> >
> > In my opinion,you means that the last block which is not aligned should be
> > encryptd with aligned by the block before last block,when encrype is over
> > ,
> > the cipher of the last block overlaying the cipher of the block before
> > last
> > block whitch is use to make the last block aligned,
> >
> > e.g.
> > algorithm: alignd to 8,
> > buffer: 1234567890123
> > first block: 12345678
> > second block: 90123
> >
> >
> > when encrypt:
> > first block is aligned to 8,so no more process require just encrypt.
> > but the second(last) block is not aligned to 8,so use first
> > block(the block before last block)add to last block aligned to 8,
> > when encrypt second(last) block the block is became 67890123, so encrypt
> > it.
> >
> > join the two blocks cipher:
> >
> > block 1 block 2
> >
> > buffer: 12345678 67890123
> > cipher: XNBJE ****** NJUEA
> >
> > join the cipher,
> > cipher part 1: XNBJE
> > cipher part 2:
NJUEA
> >
> > result: XNBJE***NJUEA
> >
> > my algorithm is block related,that means the cipher of buffer 678 in first
> > block is
> > not the same in second (last) block ,what can i do???
> >
> > and if the algorithm is not 1:1,e.g 1:1.1 or even 1:2 ,how to deal with
> > the file size???
> >
> > thank you,
> >
> > ildee
> >
> >
> >
> >
> >
>
>
>
> —
> Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: ildee@263.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

David J. Craig,
a new problem need to solve,that is if the file size is less than a block size,how to deal with such boring file??

ildee

----- Original Message -----
From: “ildee263”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, November 04, 2004 1:18 PM
Subject: Re: Re:[ntfsd] encrypt file without aligned

>
>
> oh,i see
> you means this,
>
> buffer : 1234567890123
>
> when encrypt
>
> first:
>
> 12345678
> *****
>
> second:
>
>
90123
> ########
>
> cipher is : **########
>
> when decrypt:
>
> first:
> ########
>
90123
>
> second:
> *****
> 12345678
>
> buffer: 1234567890123
>
> right???
>
> haha , i get it!!thank you!!
>
> ildee
>
> ----- Original Message -----
> From: “David J. Craig”
> Newsgroups: ntfsd
> To: “Windows File Systems Devs Interest List”
> Sent: Thursday, November 04, 2004 12:37 AM
> Subject: Re:[ntfsd] encrypt file without aligned
>
>
> > I think you need to hire a contractor to do your encryption logic. Try RSA
> > or Counterpane. Your understanding of the simple logic in this is
> > incorrect. The file size is not changed. There may be some number of bytes
> > (cipher block size - 1 or less) that are encrypted twice.
> >
> > “ildee263” wrote in message news:xxxxx@ntfsd…
> > > David J. Craig,
> > >
> > > i have found your mail as follow:
> > > ------------------------------------------------------------------------------------------
> > >
> > > Let me try a diagram:
> > >
> > > [Data nnnnnnnn bytes mod 16] [15 bytes of data]
> > >
> > > 1. Encrypt the Data nnnnnnnn bytes mod 16 first.
> > > 2. Take one byte from the end of the data encrypted in 1. and add to the
> > > front of the 15 byte remainder.
> > > 3. Encrypt that 16 byte packet.
> > > 4. Write it to the file overlaying the one byte you took out.
> > > 5. Do the decryption in reverse order doing the last 16 bytes first and
> > > then the mod 16 pieces of the file.
> > >
> > > ------------------------------------------------------------------------------------------
> > >
> > > In my opinion,you means that the last block which is not aligned should be
> > > encryptd with aligned by the block before last block,when encrype is over
> > > ,
> > > the cipher of the last block overlaying the cipher of the block before
> > > last
> > > block whitch is use to make the last block aligned,
> > >
> > > e.g.
> > > algorithm: alignd to 8,
> > > buffer: 1234567890123
> > > first block: 12345678
> > > second block: 90123
> > >
> > >
> > > when encrypt:
> > > first block is aligned to 8,so no more process require just encrypt.
> > > but the second(last) block is not aligned to 8,so use first
> > > block(the block before last block)add to last block aligned to 8,
> > > when encrypt second(last) block the block is became 67890123, so encrypt
> > > it.
> > >
> > > join the two blocks cipher:
> > >
> > > block 1 block 2
> > >
> > > buffer: 12345678 67890123
> > > cipher: XNBJE
NJUEA
> > >
> > > join the cipher,
> > > cipher part 1: XNBJE

> > > cipher part 2: NJUEA
> > >
> > > result: XNBJE
NJUEA
> > >
> > > my algorithm is block related,that means the cipher of buffer 678 in first
> > > block is
> > > not the same in second (last) block ,what can i do???
> > >
> > > and if the algorithm is not 1:1,e.g 1:1.1 or even 1:2 ,how to deal with
> > > the file size???
> > >
> > > thank you,
> > >
> > > ildee
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: ildee@263.net
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >