🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
7 messages
7 total messages Started by Maarten den Braber Fri, 07 Apr 2000 00:00
[slrn] rot13 encryption/decryption
#60289
Author: Maarten den Braber
Date: Fri, 07 Apr 2000 00:00
16 lines
1251 bytes
Hi,

A while ago there was a discussion here about rot13 encryption and
decryption in slrn. I have two questions about rot13:

- Does somebody has a patch for slrn 0.9.6.2 to also decrypt
  signatures (as in previous versions?)
- How do I _encrypt_ parts of my messages with Vim (yeah, I know
  this question belongs in comp.editors, but I'm lazy ;-)

mdb
-- 
Maarten den Braber                           mdb@twister.cx
Find what you aren't searching for:   http://www.twister.cx

Re: [slrn] rot13 encryption/decryption
#60276
Author: Damien WYART
Date: Fri, 07 Apr 2000 00:00
16 lines
1159 bytes
* Maarten den Braber <mdb@twister.cx>:

> - How do I _encrypt_ parts of my messages with Vim (yeah, I know
>   this question belongs in comp.editors, but I'm lazy ;-)

As you use vim, you will not go to hell for this anyway ;-)

[From Sven Guckes' vimrc file]

vmap ,dr :!tr A-Za-z N-ZA-Mn-za-m

(both encode or decode, in visual mode)
-- 
Damien WYART / dwyart@cybercable.fr

Re: [slrn] rot13 encryption/decryption
#60284
Author: Felix Schueller
Date: Fri, 07 Apr 2000 00:00
13 lines
1222 bytes
Am Fri, 07 Apr 2000 sendete Maarten den Braber folgende Botschaft:

>A while ago there was a discussion here about rot13 encryption and
>decryption in slrn. I have two questions about rot13:
>- How do I _encrypt_ parts of my messages with Vim (yeah, I know
>  this question belongs in comp.editors, but I'm lazy ;-)

g?

Tsch�s
  Felix

Re: [slrn] rot13 encryption/decryption
#60298
Author: Maarten den Braber
Date: Sat, 08 Apr 2000 00:00
16 lines
1275 bytes
* Felix Schueller <fschueller@netcologne.de>:
> Am Fri, 07 Apr 2000 sendete Maarten den Braber folgende Botschaft:
> 
> > How do I _encrypt_ parts of my messages with Vim (yeah, I know
> > this question belongs in comp.editors, but I'm lazy ;-)
> 
> g?

Works, thanks!

mdb
-- 
Maarten den Braber                           mdb@twister.cx
Find what you aren't searching for:   http://www.twister.cx

Re: [slrn] rot13 encryption/decryption
#60302
Author: Ralf Arens
Date: Sat, 08 Apr 2000 00:00
19 lines
1064 bytes
Damien WYART <dwyart@cybercable.fr> wrote:

> * Maarten den Braber <mdb@twister.cx>:

>> - How do I _encrypt_ parts of my messages with Vim (yeah, I know
>>   this question belongs in comp.editors, but I'm lazy ;-)

> As you use vim, you will not go to hell for this anyway ;-)

Yes, ":help g?", no need for external programs.


Ciao,
Ralf

-- 
Very funny, Scotty. Now beam down my clothes.

Re: [slrn] rot13 encryption/decryption
#60303
Author: Renaud Colinet
Date: Sat, 08 Apr 2000 00:00
163 lines
5236 bytes
On Fri, Apr 7 2000 15:45:15 +0200, Maarten den Braber wrote:
>Hi,
>
>- Does somebody has a patch for slrn 0.9.6.2 to also decrypt
>  signatures (as in previous versions?)

I can see 2 solutions to your problem. The first one will always decrypt
signatures, and consists in a single line diff:
#v+
*** art.c.orig	Sat Apr  8 13:03:31 2000
--- art.c.	Sat Apr  8 13:03:19 2000
***************
*** 7842,7847 ****
--- 7842,7848 ----
        case SIGNATURE_LINE:
  	use_emph_mask = EMPHASIZE_SIGNATURE;
  	color = SIGNATURE_COLOR;
+ 	use_rot13 = 1;
  	break;
  	
        case PGP_SIGNATURE_LINE:
#v-

The second solution defines a new configuration variable,
rot13_decoded_text_mask (inspired from emphasized_text_mask), that
allows you to choose whether you want to decrypt text, signature, or
both. You have to add this to your .slrnrc:

% rot13_decoded_text_mask determines to which portion of hte text rot13
% decoding should be applied.
% Set to 1 to decode the article (including quotes)
% Set to 2 to decode the signature only
% Set to 3 to decode both article and signature
set rot13_decoded_text_mask 3

The patch follows:
#v+
*** art.h.orig	Sat Apr  8 12:44:19 2000
--- art.h	Tue Feb 15 17:24:01 2000
***************
*** 64,69 ****
--- 64,70 ----
  #endif
  extern int Slrn_Emphasized_Text_Mode;
  extern int Slrn_Emphasized_Text_Mask;
+ extern int Slrn_Rot13_Decoded_Text_Mask;
  extern int Slrn_New_Subject_Breaks_Threads;
  extern int Slrn_Sig_Is_End_Of_Article;
  extern int Slrn_Del_Article_Upon_Read;
*** art.c.orig	Sat Apr  8 12:44:10 2000
--- art.c	Sat Apr  8 12:47:29 2000
***************
*** 115,120 ****
--- 115,124 ----
  
  int Slrn_Process_Verbatum_Marks = 1;
  
+ #define ROT13_DECODE_ARTICLE	1
+ #define ROT13_DECODE_SIGNATURE	2
+ int Slrn_Rot13_Decoded_Text_Mask = ROT13_DECODE_ARTICLE;
+ 
  Slrn_Article_Type *Slrn_Current_Article;
  
  #if SLRN_HAS_TILDE_FEATURE
***************
*** 7814,7820 ****
     char *lbuf = l->buf;
     int color;
     int use_emph_mask = 0;
!    int use_rot13 = 0;
  
     switch (l->flags & LINE_TYPE_MASK)
       {
--- 7818,7824 ----
     char *lbuf = l->buf;
     int color;
     int use_emph_mask = 0;
!    int use_rot13_mask = 0;
  
     switch (l->flags & LINE_TYPE_MASK)
       {
***************
*** 7836,7847 ****
        case QUOTE_LINE:
  	color = QUOTE_COLOR + QUOTE_LEVEL(l->flags);
  	use_emph_mask = EMPHASIZE_QUOTES;
! 	use_rot13 = 1;
  	break;
  	
        case SIGNATURE_LINE:
  	use_emph_mask = EMPHASIZE_SIGNATURE;
  	color = SIGNATURE_COLOR;
  	break;
  	
        case PGP_SIGNATURE_LINE:
--- 7840,7852 ----
        case QUOTE_LINE:
  	color = QUOTE_COLOR + QUOTE_LEVEL(l->flags);
  	use_emph_mask = EMPHASIZE_QUOTES;
! 	use_rot13_mask = ROT13_DECODE_ARTICLE;
  	break;
  	
        case SIGNATURE_LINE:
  	use_emph_mask = EMPHASIZE_SIGNATURE;
  	color = SIGNATURE_COLOR;
+ 	use_rot13_mask = ROT13_DECODE_SIGNATURE;
  	break;
  	
        case PGP_SIGNATURE_LINE:
***************
*** 7855,7861 ****
        default:
  	color = ARTICLE_COLOR;
  	use_emph_mask = EMPHASIZE_ARTICLE;
! 	use_rot13 = 1;
       }
     
     slrn_set_color (color);
--- 7860,7866 ----
        default:
  	color = ARTICLE_COLOR;
  	use_emph_mask = EMPHASIZE_ARTICLE;
! 	use_rot13_mask = ROT13_DECODE_ARTICLE;
       }
     
     slrn_set_color (color);
***************
*** 7869,7876 ****
  #endif
  
     use_emph_mask &= Slrn_Emphasized_Text_Mask;
  
!    if (Do_Rot13 && use_rot13)
       {
  	write_rot13 ((unsigned char *) lbuf, use_emph_mask, color);
  	return;
--- 7874,7883 ----
  #endif
  
     use_emph_mask &= Slrn_Emphasized_Text_Mask;
+    use_rot13_mask &= Slrn_Rot13_Decoded_Text_Mask;
+ 
  
!    if (Do_Rot13 && use_rot13_mask)
       {
  	write_rot13 ((unsigned char *) lbuf, use_emph_mask, color);
  	return;
*** startup.c.orig	Sat Apr  8 12:43:54 2000
--- startup.c	Fri Apr  7 17:22:25 2000
***************
*** 334,339 ****
--- 334,340 ----
       {"hide_signature",	&Slrn_Signature_Hidden},
       {"hide_pgpsignature",	&Slrn_Pgp_Signature_Hidden},
       {"emphasized_text_mask",	&Slrn_Emphasized_Text_Mask},
+      {"rot13_decoded_text_mask", &Slrn_Rot13_Decoded_Text_Mask},
       {"emphasized_text_mode",	&Slrn_Emphasized_Text_Mode},
       {"process_verbatum_marks", &Slrn_Process_Verbatum_Marks},
#v-  
-- 
Renaud

Re: [slrn] rot13 encryption/decryption
#60311
Author: Maarten den Braber
Date: Sat, 08 Apr 2000 00:00
16 lines
1267 bytes
* Damien WYART <dwyart@cybercable.fr>:
> * Maarten den Braber <mdb@twister.cx>:
> 
> > How do I _encrypt_ parts of my messages with Vim (yeah, I know
> > this question belongs in comp.editors, but I'm lazy ;-)
> 
> vmap ,dr :!tr A-Za-z N-ZA-Mn-za-m

Thanks. It works

mdb
-- 
Maarten den Braber                           mdb@twister.cx
Find what you aren't searching for:   http://www.twister.cx

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads